@Sathaiah :
offcourse XOR have problem . All tha other numbers are not repeated even
nuber of times so its not necessary that they cut out to give 0
for eg a[]={1,3,4,1,4,5,6,1,5,6}

XOR will give output as 1^3 which is not done
If every other element is repeated even times then XOR is OK

@jalaj :
You cant find the unique element in a unsorted array any less than O(n).
Minimum complexity will be O(n).
One have to traverse the whole array atleast once to find the distinct
element

comments are welcomed...

-- 
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.

Reply via email to