try this:
   sq(i, j)= k  is maximum sqare possible ending at i, j and has
length k in the matrix iXj

    sq(i, j) = k                   if {sq( i -1, j-1) && AllOnes(i,0,
k) && AllOnes(0, j, k)}
               = 1                   if sq(i, j) == 1
               = 0                   otherwise


On Oct 31, 10:36 pm, SAMM <[email protected]> wrote:
> Any body got any idea of just how to approach???? It need a DP algo.
>
> On 10/30/11, SAMMM <[email protected]> wrote:
>
>
>
> > Suppose u have a square matrix, where every cell is filled with 0 or
> > 1 . U need to find the maximum subsquare such that all four borders
> > are filled with all 1s.
>
> > Ex:-
>
> > 1 0 0 1 1 0
> > 1 0 1 1 1 0
> > 0 0 1 0 1 1
> > 0 1 1 1 1 0
> > 1 0 0 1 1 1
>
> > Here the maximum square (3X3) possible is from the TOP LEFT (2 3) TO
> > BOTTOM RIGHT (4 5) .
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> >http://groups.google.com/group/algogeeks?hl=en.
>
> --
> Somnath Singh

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to