@ Don exactly waht u write i wanted to say

On Fri, Aug 26, 2011 at 11:52 AM, tech coder <[email protected]>wrote:

> @Tech: I'm not sure I understand your algorithm. Let's try it on
> {1,1,2,2,3,4,5,5,6,6,7,7}. The two number occurring an odd number of
> times are 3 and 4. We xor the numbers getting 7 = 111 in binary. Now
> how do we divide the numbers into two groups?
>
> see we come to know that both number differ at bit1  bit2 and bit3  we need
> only bit1
>
> set1 contain the numbers whose bit1 is set including 3
> set2 contain the numbers whose bit1 is clear including  4
>
> now xoring 1st set we get 3
> xor ing 2nd set we get 4
>     (bacuase all others appear even no of time  they will nullify each
> other)
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to