Re: [algogeeks] Re: is it possible to detect the first repeating number in a 2-D array (n X n) in O(n) time ?

2011-07-19 Thread ~*~VICKY~*~
Ya sorry abt that my algo is wrong! On Tue, Jul 19, 2011 at 3:35 PM, Bhanu Kishore wrote: > @Venkat. That algorithm doesnt work actually.Try for 9,8,1. At 1 , it > becomes 0. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post t

Re: [algogeeks] Re: is it possible to detect the first repeating number in a 2-D array (n X n) in O(n) time ?

2011-07-19 Thread snehi jain
@Dumanshu: i know you have given a good explanation but i have never done parallel computing.. could you illustrate a bit more especially about the n+1th process.. On Tue, Jul 19, 2011 at 3:35 PM, Bhanu Kishore wrote: > @Venkat. That algorithm doesnt work actually.Try for 9,8,1. At 1 , it > becom

Re: [algogeeks] Re: is it possible to detect the first repeating number in a 2-D array (n X n) in O(n) time ?

2011-07-19 Thread Bhanu Kishore
@Venkat. That algorithm doesnt work actually.Try for 9,8,1. At 1 , it becomes 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 a

[algogeeks] Re: is it possible to detect the first repeating number in a 2-D array (n X n) in O(n) time ?

2011-07-19 Thread ((** VICKY **))
doing xor of all elements in array[][] should work. you start from a[0] [0] to a[0][n] then a[1][0] .. when the xor value bcomz 0 then the corresponding value in arr[i][j] is the first repeated element in the array. though this code will have two loops and seem as O(n2) it will terminate once it fi

[algogeeks] Re: is it possible to detect the first repeating number in a 2-D array (n X n) in O(n) time ?

2011-07-18 Thread Dumanshu
You have to use parallel computing to find the first repeating number in O(n) time if theres nothing special about the 2-D array Use n +1 processes, n processes to scan each row and 1 process to scan the rows last and next rows first element to check for repetition. Each process uses hash table to