Subj : Re: puzzle To : comp.programming From : Joe Seigh Date : Sun Jul 10 2005 02:02 pm CBFalconer wrote: > spinoza1111@yahoo.com wrote: > > ... snip ... > >>in this thread, I have repeatedly acknowledged that I did not have >>enough erudition to think of, or in my case from grad school >>remember, the XOR solution. > > ... snip further pointless erudition ... > > FYI, the entire secret of the XOR solution is exposed in the > following truth table: > > a b XOR(a,b) > = = ======== > F F F > F T T > T F T > T T F > > Some have been known to learn this without attending grad school. > To make things interesting, this problem should be reposed as, you have a unordered sequence of the numbers 0 to n with one number missing and the others appearing only once. Find two O(n) ways of determining the missing number. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. .