Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
i cnt get logic...xplain mre.thnx in advnce

On Fri, Sep 30, 2011 at 6:16 PM, rahul sharma wrote:

> plz xplain result after first scaning
>
>
> On Fri, Sep 30, 2011 at 5:05 PM, Ankur Garg  wrote:
>
>> @Rahul
>> Scan the matrix and whenver u see  a[i][j]=0 put a[i]]0]=0 and a[0][j]=0
>>
>> Meaning to say that put that row or column as 0
>>
>> Now,
>> Scan the first row and first column and whereever u see a 0 make that
>> column and row 0 respectively
>>
>> Eg
>>
>> 1 1 1 1
>> 0 1 0 1
>> 1 1 1 0
>>
>> Answer shud be
>>
>> 0  1 0 0
>> 0 0 0 0
>> 0 0 0 0
>>
>> Scan Array First After Scanning it become
>>
>> 0 1 0 0
>> 0 1 0 1
>> 0 1 1 1
>> Now Scan first row and for a[0][j]  make a[i][j] 0
>> so
>>
>> 0 1 0 0
>> 0 1 0 0
>> 0  1 0 0
>> Now scan column ..Remember to start from a[1][0] and a[0][1]
>>
>> 0 1 0 0
>> 0  0 0 0
>> 0 0 0 0
>>
>> Hope it helps
>>
>> Ankur
>>
>>
>> On Fri, Sep 30, 2011 at 3:47 PM, rahul sharma wrote:
>>
>>> provide me with o(1) space ...i need it vey urgent.can it be
>>> done...thnx in advance.
>>>
>>>
>>> On Fri, Sep 30, 2011 at 3:44 PM, rahul sharma 
>>> wrote:
>>>
 sorry n*m complex where n rows and m col
 but correct for space pzl and it uses two xtras array row and col


 On Fri, Sep 30, 2011 at 3:42 PM, rahul sharma 
 wrote:

> i cant find xact soln on previous threadi have sol with n*n
> complexity  but used space,, i.e
>
> scan whole matrix
> if( matrix([i][j]==1)
> {
> row[i]=1;
> col[j]=1;
> }
>
> scan agin
> if(row[i]==1 ||| col[j]==1)
> matrix[i][j]=0;
>
>
> two n*n loops so takes n*n and uses space too plz give me opt. soln
>
> On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav wrote:
>
>> Already discussed
>>
>>
>> https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=en&lnk=gst&q=MS+question+ankur#66bb2e804b43ae1d
>>
>> .
>>
>>
>> On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak <
>> sumitkp1...@gmail.com> wrote:
>>
>>> *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;jmatrix[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.
>>>
>>
>>  --
>> 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+unsub

Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
plz xplain result after first scaning

On Fri, Sep 30, 2011 at 5:05 PM, Ankur Garg  wrote:

> @Rahul
> Scan the matrix and whenver u see  a[i][j]=0 put a[i]]0]=0 and a[0][j]=0
>
> Meaning to say that put that row or column as 0
>
> Now,
> Scan the first row and first column and whereever u see a 0 make that
> column and row 0 respectively
>
> Eg
>
> 1 1 1 1
> 0 1 0 1
> 1 1 1 0
>
> Answer shud be
>
> 0  1 0 0
> 0 0 0 0
> 0 0 0 0
>
> Scan Array First After Scanning it become
>
> 0 1 0 0
> 0 1 0 1
> 0 1 1 1
> Now Scan first row and for a[0][j]  make a[i][j] 0
> so
>
> 0 1 0 0
> 0 1 0 0
> 0  1 0 0
> Now scan column ..Remember to start from a[1][0] and a[0][1]
>
> 0 1 0 0
> 0  0 0 0
> 0 0 0 0
>
> Hope it helps
>
> Ankur
>
>
> On Fri, Sep 30, 2011 at 3:47 PM, rahul sharma wrote:
>
>> provide me with o(1) space ...i need it vey urgent.can it be
>> done...thnx in advance.
>>
>>
>> On Fri, Sep 30, 2011 at 3:44 PM, rahul sharma wrote:
>>
>>> sorry n*m complex where n rows and m col
>>> but correct for space pzl and it uses two xtras array row and col
>>>
>>>
>>> On Fri, Sep 30, 2011 at 3:42 PM, rahul sharma 
>>> wrote:
>>>
 i cant find xact soln on previous threadi have sol with n*n
 complexity  but used space,, i.e

 scan whole matrix
 if( matrix([i][j]==1)
 {
 row[i]=1;
 col[j]=1;
 }

 scan agin
 if(row[i]==1 ||| col[j]==1)
 matrix[i][j]=0;


 two n*n loops so takes n*n and uses space too plz give me opt. soln

 On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav wrote:

> Already discussed
>
>
> https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=en&lnk=gst&q=MS+question+ankur#66bb2e804b43ae1d
>
> .
>
>
> On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak <
> sumitkp1...@gmail.com> wrote:
>
>> *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>>>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.
>>
>
>  --
> 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@goo

Re: [algogeeks] urgent soln needed

2011-09-30 Thread Ankur Garg
@Rahul
Scan the matrix and whenver u see  a[i][j]=0 put a[i]]0]=0 and a[0][j]=0

Meaning to say that put that row or column as 0

Now,
Scan the first row and first column and whereever u see a 0 make that column
and row 0 respectively

Eg

1 1 1 1
0 1 0 1
1 1 1 0

Answer shud be

0  1 0 0
0 0 0 0
0 0 0 0

Scan Array First After Scanning it become

0 1 0 0
0 1 0 1
0 1 1 1
Now Scan first row and for a[0][j]  make a[i][j] 0
so

0 1 0 0
0 1 0 0
0  1 0 0
Now scan column ..Remember to start from a[1][0] and a[0][1]

0 1 0 0
0  0 0 0
0 0 0 0

Hope it helps

Ankur

On Fri, Sep 30, 2011 at 3:47 PM, rahul sharma wrote:

> provide me with o(1) space ...i need it vey urgent.can it be
> done...thnx in advance.
>
>
> On Fri, Sep 30, 2011 at 3:44 PM, rahul sharma wrote:
>
>> sorry n*m complex where n rows and m col
>> but correct for space pzl and it uses two xtras array row and col
>>
>>
>> On Fri, Sep 30, 2011 at 3:42 PM, rahul sharma wrote:
>>
>>> i cant find xact soln on previous threadi have sol with n*n
>>> complexity  but used space,, i.e
>>>
>>> scan whole matrix
>>> if( matrix([i][j]==1)
>>> {
>>> row[i]=1;
>>> col[j]=1;
>>> }
>>>
>>> scan agin
>>> if(row[i]==1 ||| col[j]==1)
>>> matrix[i][j]=0;
>>>
>>>
>>> two n*n loops so takes n*n and uses space too plz give me opt. soln
>>>
>>> On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav  wrote:
>>>
 Already discussed


 https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=en&lnk=gst&q=MS+question+ankur#66bb2e804b43ae1d

 .


 On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak <
 sumitkp1...@gmail.com> wrote:

> *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  > wrote:
>
>> it will zero only row not column
>>
>> On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze > > wrote:
>>
>>>
>>> if(matrix[i][j]==0){
>>>   for(int j=0;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.
>

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



Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
sorry n*m complex where n rows and m col
but correct for space pzl and it uses two xtras array row and col

On Fri, Sep 30, 2011 at 3:42 PM, rahul sharma wrote:

> i cant find xact soln on previous threadi have sol with n*n complexity
>  but used space,, i.e
>
> scan whole matrix
> if( matrix([i][j]==1)
> {
> row[i]=1;
> col[j]=1;
> }
>
> scan agin
> if(row[i]==1 ||| col[j]==1)
> matrix[i][j]=0;
>
>
> two n*n loops so takes n*n and uses space too plz give me opt. soln
>
> On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav  wrote:
>
>> Already discussed
>>
>>
>> https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=en&lnk=gst&q=MS+question+ankur#66bb2e804b43ae1d
>>
>> .
>>
>>
>> On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak <
>> sumitkp1...@gmail.com> wrote:
>>
>>> *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 
>>> wrote:
>>>
 it will zero only row not column

 On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze 
 wrote:

>
> if(matrix[i][j]==0){
>   for(int j=0;jmatrix[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.
>>>
>>
>>  --
>> 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.



Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
i cant find xact soln on previous threadi have sol with n*n complexity
 but used space,, i.e

scan whole matrix
if( matrix([i][j]==1)
{
row[i]=1;
col[j]=1;
}

scan agin
if(row[i]==1 ||| col[j]==1)
matrix[i][j]=0;


two n*n loops so takes n*n and uses space too plz give me opt. soln

On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav  wrote:

> Already discussed
>
>
> https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=en&lnk=gst&q=MS+question+ankur#66bb2e804b43ae1d
>
> .
>
>
> On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak  > wrote:
>
>> *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 wrote:
>>
>>> it will zero only row not column
>>>
>>> On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze wrote:
>>>

 if(matrix[i][j]==0){
   for(int j=0;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.
>>
>
>  --
> 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.



Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
provide me with o(1) space ...i need it vey urgent.can it be done...thnx
in advance.

On Fri, Sep 30, 2011 at 3:44 PM, rahul sharma wrote:

> sorry n*m complex where n rows and m col
> but correct for space pzl and it uses two xtras array row and col
>
>
> On Fri, Sep 30, 2011 at 3:42 PM, rahul sharma wrote:
>
>> i cant find xact soln on previous threadi have sol with n*n complexity
>>  but used space,, i.e
>>
>> scan whole matrix
>> if( matrix([i][j]==1)
>> {
>> row[i]=1;
>> col[j]=1;
>> }
>>
>> scan agin
>> if(row[i]==1 ||| col[j]==1)
>> matrix[i][j]=0;
>>
>>
>> two n*n loops so takes n*n and uses space too plz give me opt. soln
>>
>> On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav  wrote:
>>
>>> Already discussed
>>>
>>>
>>> https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=en&lnk=gst&q=MS+question+ankur#66bb2e804b43ae1d
>>>
>>> .
>>>
>>>
>>> On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak <
>>> sumitkp1...@gmail.com> wrote:
>>>
 *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 
 wrote:

> it will zero only row not column
>
> On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze 
> wrote:
>
>>
>> if(matrix[i][j]==0){
>>   for(int j=0;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.

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



Re: [algogeeks] urgent soln needed

2011-09-30 Thread Yogesh Yadav
Already discussed

https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=en&lnk=gst&q=MS+question+ankur#66bb2e804b43ae1d

.

On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak
wrote:

> *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 wrote:
>
>> it will zero only row not column
>>
>> On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze wrote:
>>
>>>
>>> if(matrix[i][j]==0){
>>>   for(int j=0;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.
>

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



Re: [algogeeks] urgent soln needed

2011-09-30 Thread sumit kumar pathak
*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 wrote:

> it will zero only row not column
>
> On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze wrote:
>
>>
>> if(matrix[i][j]==0){
>>   for(int j=0;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.



Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
it will zero only row not column
On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze wrote:

>
> if(matrix[i][j]==0){
>   for(int j=0;jmatrix[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.



Re: [algogeeks] urgent soln needed

2011-09-29 Thread Tamanna Afroze
if(matrix[i][j]==0){
  for(int j=0;jhttp://groups.google.com/group/algogeeks?hl=en.



[algogeeks] urgent soln needed

2011-09-29 Thread rahul sharma
if matrix [i][j]=0
then entire row n column should be set to zero with min tym n space
complexity.o(n) tym n o
(1) space

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