
7 Oct
2011
7 Oct
'11
4:14 p.m.
Den 07-10-2011 18:11, Phil Endecott skrev:
The need to use a temporary is not inherent in the algorithm; if I'm swapping ints my processor might be able to do that with a single instruction and no (apparent) temporary. And then there are classic nasty tricks like
a -= b; b += a; a = b-a;
Or the swap-by-XORing trick. -Thorsten