Monday, September 10, 2007

Swap Variables with Zero Space Requirement

void zero_space_swap(int* x, int *y){
     *(x) ^= *(y);
     *(y) ^= *(x);
     *(x) ^= *(y);
}

No comments: