Possible Duplicate:
Finding a single number in a list
What to be a good algorithm given an array of integers, all but one of which appears an even number of times, find the one integer which appears an odd number of times.
Perhaps something along the lines of binary search like sum all elements of 2 small arrays of n/2 size, compare recursively find out?
Edit:
Is this XOR algorithm actually assuming {1,1,4,4,7,7,5,8,8,9,9}? My input can be randmon too - { 1,4,1,8,9,5,4,5,9,8}. So the logic changes in that case?