[algogeeks] Find the non-duplicate element in sorted array in O(n) time

2011-08-24 Thread atul purohit
Hi, A* sorted *integer array contains elements in pairs. All the pairs are complete except one element whose pair is missing. Find that element. Ex. { 1,1,2,2,2,2,3,3,4,5,5} result = 5 There is a standard solution which returns an XOR of all the elements. But this needs O(n) time complexity.

Re: [algogeeks] Algorithm

2011-08-16 Thread atul purohit
this group at http://groups.google.com/group/algogeeks?hl=en. -- Atul Purohit -- 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

Re: [algogeeks] Coding..........

2011-07-21 Thread atul purohit
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Atul Purohit -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

Re: [algogeeks] Coding..........

2011-07-21 Thread atul purohit
@puuneet http://en.wikipedia.org/wiki/Sorting_algorithm#Stability On Fri, Jul 22, 2011 at 10:57 AM, Puneet Gautam puneet.nsi...@gmail.comwrote: What is meant by maintaining the stability...? pls tell me...!! Thanks. On 7/22/11, atul purohit gonewiththe...@gmail.com wrote: here in O(n

Re: [algogeeks] C function prob

2011-07-18 Thread atul purohit
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Atul Purohit -- 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

Re: [algogeeks] Tournament Tree

2011-07-18 Thread atul purohit
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Atul Purohit -- 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

Re: [algogeeks] Re: amazon

2011-07-13 Thread atul purohit
this group at http://groups.google.com/group/algogeeks?hl=en. -- Atul Purohit -- 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

Re: [algogeeks] Re: Yahoo Question

2011-07-12 Thread atul purohit
at http://groups.google.com/group/algogeeks?hl=en. -- Atul Purohit -- 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

Re: [algogeeks] Re: O(n) Time is the problem. ..

2011-07-10 Thread atul purohit
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. -- Atul Purohit -- You received this message because you are subscribed

[algogeeks] Finding a number from 300million list with constraint on memory.

2011-06-23 Thread atul purohit
Hi, Can someone explain me how to do this. Given a file containing roughly 300 million 9-digit numbers. Find a 9-digit number that isn't present in the file.You have unlimited drive space but only 2MB of RAM available. I suppose we have to use bit-vectors n all but still couldnt figure out a

Re: [algogeeks] Finding a number from 300million list with constraint on memory.

2011-06-23 Thread atul purohit
all this blocks for the number. On Thu, Jun 23, 2011 at 9:59 AM, atul purohit gonewiththe...@gmail.com wrote: Hi, Can someone explain me how to do this. Given a file containing roughly 300 million 9-digit numbers. Find a 9-digit number that isn't present in the file.You have

Re: [algogeeks] Finding a number from 300million list with constraint on memory.

2011-06-23 Thread atul purohit
for the number untill you reach the end of file is O(n). On Thu, Jun 23, 2011 at 12:17 PM, atul purohit gonewiththe...@gmail.com wrote: Hi, While external sorting is a probable way to sort it. Still it changes the content and time complexity will be O(n). It is a trivial job to copy

Re: [algogeeks] Finding a number from 300million list with constraint on memory.

2011-06-23 Thread atul purohit
is in file A. Then we read number from file A, proceed the above procedure, test with number n/4. The procedure goes on until we find the missing. The method only works on there is no duplicate in the numbers. On Thu, Jun 23, 2011 at 11:17 AM, atul purohit gonewiththe...@gmail.comwrote: Hi