http://codepad.org/8eDVyeBT
Using XOR logic we can find Duplicates in O(n) On Thu, Aug 5, 2010 at 11:25 AM, ravindra patel <[email protected]>wrote: > Your test case is wrong. With this pattern you can have at max n/3 > occurrences of 1. The questions says that repeated element has n/2 > occurrences > > > On Thu, Aug 5, 2010 at 8:37 PM, Manjunath Manohar < > [email protected]> wrote: > >> consider the test case of... >> >> 1 2 3 1... >> >> 1 repeated n/2 times and 2,3 are distinct n/2 elements >> >> for this the algo will not work >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<algogeeks%[email protected]> >> . >> 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
