22,99 €
inkl. MwSt.

Versandfertig in 6-10 Tagen
  • Broschiertes Buch

High Quality Content by WIKIPEDIA articles! In computer programming, the XOR swap is an algorithm that uses the XOR bitwise operation to swap values of distinct variables having the same data type without using a temporary variable. "Distinct" means that the variables are stored at distinct memory addresses; the actual values of the variables do not have to be different. Conventional swapping requires the use of a temporary storage variable. Using the XOR swap algorithm, however, no temporary storage is needed. The algorithm typically corresponds to three machine code instructions. Since XOR…mehr

Produktbeschreibung
High Quality Content by WIKIPEDIA articles! In computer programming, the XOR swap is an algorithm that uses the XOR bitwise operation to swap values of distinct variables having the same data type without using a temporary variable. "Distinct" means that the variables are stored at distinct memory addresses; the actual values of the variables do not have to be different. Conventional swapping requires the use of a temporary storage variable. Using the XOR swap algorithm, however, no temporary storage is needed. The algorithm typically corresponds to three machine code instructions. Since XOR is a commutative operation, X XOR Y can be replaced with Y XOR X in any of the lines.