Re: [algogeeks] Re: Sub-2Dmatrix maximum

2010-07-12 Thread Amir hossein Shahriari
here's an algorithm that can find the the max black rectangle in O(n^3) here sum[i][j] is the number of contiguous 1s in the ith row from j column until the end of the row for (i=0;i=0;j--){ if (a[i][j]==1) sum[i][j]=1+sum[i][j+1]; else sum[i][j]=0; } } so now sum[][] tells us how far we can go

[algogeeks] Re: Sub-2Dmatrix maximum

2010-07-11 Thread Debajyoti Sarma
I was talking about this approach. for( left_top_i=0 ; left_top_ihttp://groups.google.com/group/algogeeks?hl=en.