Interview Question

Intern Software Development Engineer Interview

given an array of nonnegative integers and the size of the

  array, within the array every number except one number appears an even number of times, the other is appears an odd number of times, write a function to return the number that appears an odd number of times.
Answer

Interview Answer

1 Answer

0

You can use bitwise XOR operation to answer this question. Detail answer can be found here http://www.geeksforgeeks.org/find-the-number-occurring-odd-number-of-times/

thanh nguyen on Dec 24, 2013

Add Answers or Comments

To comment on this question, Sign In with Facebook or Sign Up