Two Dimensional Peak Finding
Two Dimensional Peak Finding Two dimensional peak finding finds a position in a matrix whose value is at least as large as its neighbors in four directions. Given a matrix $A$ of size $n \times m$, a position $(i, j)$ is a peak if: $A[i][j] \ge A[i-1][j]$ $A[i][j] \ge A[i+1][j]$ $A[i][j] \ge A[i][j-1]$ $A[i][j] \ge A[i][j+1]$ Out of bounds neighbors are treated as $-\infty$. Problem Given a matrix $A$, find...