@Dave nice algorithm

On Fri, Dec 24, 2010 at 6:59 PM, Dave <[email protected]> wrote:

> @Monty: Use an alternating across and down algorithm:
>
> Set the current row = the first row
> While current row is not the last row
>    Look across the current row for the first false
>    Look down the column containing that first false for a true
>    If no such row is found, break. // current row is the result
> End While
>
> Since you only go to the right and down, you can't take more than m +
> n steps.
>
> Dave
>
> On Dec 24, 5:46 am, monty 1987 <[email protected]> wrote:
> > Given a boolean matrix with all the true elements on left side in the row
> so
> > that each row can be broken into two parts left part containing only true
> > elements and right part containing only false elements. Find the row with
> > max number of true elements in it.
> >
> > if the size of matrix is m*n then it can be solved in O(m+n) time.
> > Any bettar solution..........
>
> --
> 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]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
bhupendra dubey

-- 
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