Then it can be done by taking the xor product of all number present in the list & the number from 0 to 2^32,which would give the missing number.. Example:- for list (5 3 1 4) contain number from 1 to 5 ,2 is missing .Taking the xor of all elements and all number expected to present i:e index from 1 to 5 ,
(5 3 1 4 1 2 3 4 5) xor will give 2 which is missing . space complexityO(1), runtime complexityO(n) On 7/18/11, ankit sambyal <ankitsamb...@gmail.com> wrote: > I also interpreted it the same way > > -- > 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. > > -- Somnath Singh -- 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.