you dont NEED a temporary variable, you can just use the XOR operator if your language has it, example in C: a = a ^ b; b = b ^ a; a = a ^ b; and you can even make it a function by accepting pointers: int swap(int *a, int *b){ *a = *a ^ *b; *b = *b ^ *a; *a = *a ^ *b; return 0; }
@YousefAbokhadra-pe1tx16 күн бұрын
We do not care
@AnishAnish-jc9rr16 күн бұрын
No wonder ya got no comments this is child knowledge