4 ms·
Which comes with the obligatory reminder that it fails when a == b.
by samatman 9y ago
Which comes with the obligatory reminder that it fails when a == b.
- twtw 9y agoNo it doesn't. xor swap works fine when the two values are equal. The problem is when &a == &b.