how abt this:

if(!a[0][0])
    {
first traverse the 1st row till we find any 1...

On Sep 2, 12:32 pm, kranthi raj <kranthi...@gmail.com> wrote:
> oops missed Space Complexity
>
>
>
>
>
> On Fri, Sep 2, 2011 at 12:55 PM, kranthi raj <kranthi...@gmail.com> wrote:
> > for( i = 0 ; i < n ; ++i )
> >    for( j = 0 ; j < m ; ++j )
> >        if( a[i][j] != 0 )
> >             row[j]=col[i]=1;
>
> > for( i = 0 ; i < n ; ++i )
> >    for( j = 0 ; j < m ; ++j )
>
> >        {
> >            if (row[j]==1 || col[i]==1)
> >                  a[i][j]=1;
> >        }
>
> > Does this work?
>
> --
>    Sincerely,
>     Kranthi Raj A
>     2nd Mtech
>     Dept Of Computer Science ,
>     Indian Institute of Technology, Madras
>    
> #9884989577begin_of_the_skype_highlighting              9884989577      end_of_the_skype_highlighting

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

Reply via email to