Tag Archive

Interchanging 2 variables without the use of a third

Published on March 9, 2009 By admin

One of the interesting problems witch every programmer is faced when target device do not have so many memory availble is to interchange 2 variables widthout using a third one: Theory: a b a XOR b 0 0 0 0 1 1 1 0 1 1 1 0 . a 0101 b 0011 a = [...]