3 ms·
It would set a[i] to zero instead of swapping two values, right?
by vaylian 1y ago
It would set a[i] to zero instead of swapping two values, right?
- praptak 1y agoYes. Now we only need a legit use case for code that swaps values only if they are in different locations, otherwise zeroes the aliased location. Then we can finally do it using the xor swap!