Tag Archives: matrix

Find values at kth row are 0 and kth column in a 2D matrix are 1

This problem is from G4G: http://www.geeksforgeeks.org/find-k-such-that-all-elements-in-kth-row-are-0-and-kth-column-are-1-in-a-boolean-matrix/ The problem ask us to find a number k, where the kth row of is all 0, kth column is all 1 too. The value of [k, k] can be either 0 or 1. Take below array as example: The kth row/column should be 3: The trick of this problem is… Read More »

Find peak in matrix

This is eveolved from 1D problem – find local min. I would say this is a interesting problem and hvae great solution. The definition of “local” is near elements, ans in same row or column. There is junmin’s implementation, link , which is similar to mine. And another very clear material from mit, link. package… Read More »