Comments on: Programming Interview Questions 22: Find Odd Occurring Element /2011/12/13/programming-interview-questions-22-find-odd-occurring-element/?utm_source=rss&utm_medium=rss&utm_campaign=programming-interview-questions-22-find-odd-occurring-element Information Retrieval and Machine Learning Mon, 23 Jan 2012 19:14:24 +0000 hourly 1 http://wordpress.org/?v=3.3 By: Arden /2011/12/13/programming-interview-questions-22-find-odd-occurring-element/#comment-759 Arden Wed, 14 Dec 2011 09:04:00 +0000 /?p=883#comment-759 Here's the C/C++ code: <pre lang="cpp" escaped="true"> int getOdd(int *arr, int size) { int result=0; for(int i=0; i<size; i++) { result^=arr[i]; } return result; } </pre> And here's the python reference for reduce: http://docs.python.org/library/functions.html#reduce Here’s the C/C++ code:

int getOdd(int *arr, int size)
{
    int result=0;
    for(int i=0; i<size; i++)
    {
        result^=arr[i];
    }
    return result;
}

And here’s the python reference for reduce:

]]>
By: umar /2011/12/13/programming-interview-questions-22-find-odd-occurring-element/#comment-758 umar Wed, 14 Dec 2011 08:52:10 +0000 /?p=883#comment-758 def getOdd(arr): return reduce(lambda x, y: x^y, arr) Can u Write above algo in C++. what is reduce? def getOdd(arr):
return reduce(lambda x, y: x^y, arr)

Can u Write above algo in C++.

what is reduce?

]]>