Given an array of integers ,You have to find two elements whose XOR is maximum.
There is naive approach --just by picking each element and xoring with other elemen
A very interesting problem! Here is my idea:
If a and b reach a leaf, the should point to two numbers with "very few" identical bits.
I just made this algorithm up and do not know if its correct or how to prove it. However it should be in O(n) running time.