Re: [algogeeks] Printing unique rows.

2011-06-30 Thread Jitendra singh
we can convert all rows in an equivalent integer and then sort all numbers and for(int i=1;i=n;i++) { if(sorted[i]==sorted[i-1]) prinf(sorted[i]); } On 6/28/11, sunny agrawal sunny816.i...@gmail.com wrote: @Ankit if N is large how will you hash the rows, numbers will be very large can

Re: [algogeeks] Printing unique rows.

2011-06-28 Thread sunny agrawal
if N = 64 then we can convert all rows in an equivalent integer and then sort all numbers and print distinct No.s else Worst case Solution would be to to check for each pair of rows and match - O(N^3) one more solution i can think of is to divide and conquer solution which goes like this based

Re: [algogeeks] Printing unique rows.

2011-06-28 Thread Ankit Agrawal
u can use hashing ... hash fun can b base2 to base10 -- 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

Re: [algogeeks] Printing unique rows.

2011-06-28 Thread Piyush Sinha
In any case, I don't think the complexity can be improved from O(n^2) because even in creating hash function every column element of every row which itself is N^2 only.. On Tue, Jun 28, 2011 at 11:38 AM, Ankit Agrawal ankitmnnit.agra...@gmail.com wrote: u can use hashing ... hash fun can b

Re: [algogeeks] Printing unique rows.

2011-06-28 Thread sunny agrawal
@Ankit if N is large how will you hash the rows, numbers will be very large can you explain using given example ? On Tue, Jun 28, 2011 at 11:38 AM, Ankit Agrawal ankitmnnit.agra...@gmail.com wrote: u can use hashing ... hash fun can b base2 to base10 -- You received this message because

[algogeeks] Printing unique rows.

2011-06-27 Thread oppilas .
Given a binary matrix of N X N of integers , you need to return only unique rows of binary arrays eg: 0 1 0 0 1 1 0 1 1 0 0 1 0 0 1 1 1 1 0 0 ans: 0 1 0 0 1 1 0 1 1 0 1 1 1 0 0 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this