Re: [algogeeks] Re: Maximum size square sub-matrix with all 1s

2012-01-10 Thread Yogesh Yadav
g[][]- given matrix r[][]- result matrix copy first row n column from g[][] to r[][] rest for i=1 to n-1 for =1 to n-1j if(g[][]) r[][]=min(r[i][j-1],r[i-1][j],r[i-1][j-1])+1; else r[][]=0; On Wed, Jan 11, 2012 at 10:00 AM, Gene wrote: > The 1's and 0's are in matrix R. We w

[algogeeks] Re: Maximum size square sub-matrix with all 1s

2012-01-10 Thread Gene
The 1's and 0's are in matrix R. We want to compute an integer matrix M of the same dimensions as R such that Mij is the size of the largest square of 1's of which Rij is the bottom right corner. As we go we can keep track of max(Mij), and this will be the answer. So how to compute Mij? The val