XOR Properties
Learn XOR Properties (Bit Manipulation, Data Structures & Algorithms) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
The Core XOR Identities a ^ 0 = a - XOR with 0 is the identity operation. a ^ a = 0 - a number XORed with itself cancels out to 0. a ^ b = b ^ a - commutative. (a ^ b) ^ c = a ^ (b ^ c) - associative, so order/grouping in a chain of XORs doesn't matter. These four identities alone unlock the "find the unique/missing element" family of interview problems.