*find all the zeros in first iteration and store (size = array bool [2n])* *and then make zero. * *time = O(n^2)* *space = O(n)* * * *case 2:* * if any zero whole matrix zero, (once we get a zero its row and column will become zero which in turn lead to whole matrix being zero). * * *regards - Sumit Kumar Pathak (Sumit/ Pathak/ SKP ...) *Smile is only good contagious thing.* *Spread it*!!!!!
On Fri, Sep 30, 2011 at 2:38 PM, rahul sharma <rahul23111...@gmail.com>wrote: > it will zero only row not column > > On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze <afroze...@gmail.com>wrote: > >> >> if(matrix[i][j]==0){ >> for(int j=0;j<n;j++) >> matrix[i][j]=0; >> } >> >> -- >> 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. >> > > -- > 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. > -- 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.