Got it.. basically i thought that
1. XOR at bit level is OK.. but for any number a, i was wondering what
would ~a be.. (0?). But actually a XOR b would be nothing but their
corresponding bitwise XORs.
2. Also, a XOR b = a. ~b + ~a.b. Thus if we expand the expression [a
XOR b XOR c n
Hangjin Zhang wrote:
Do an XOR on all numbers. The resulte is the number which occurs only once
HZ
On 12/30/06, Abhishek [EMAIL PROTECTED] wrote:
Hi,
Suppose I have a sequence of numbers in which every number occurs twice
in the sequence except one. Whats the fastest way of finding that
XOR is the best computationally as well as space complexity.
On 1/16/07, Satish [EMAIL PROTECTED] wrote:
Hangjin Zhang wrote:
Do an XOR on all numbers. The resulte is the number which occurs only
once
HZ
On 12/30/06, Abhishek [EMAIL PROTECTED] wrote:
Hi,
Suppose I have a
Do an XOR on all numbers. The resulte is the number which occurs only once
HZ
On 12/30/06, Abhishek [EMAIL PROTECTED] wrote:
Hi,
Suppose I have a sequence of numbers in which every number occurs twice
in the sequence except one. Whats the fastest way of finding that
number which occurs only