AANSHinbitmanipulation.hashnode.dev·Aug 4, 2024 · 3 min readManipulating BitsFind the Bit at ith Position To find the Bit at the ith Position we use AND Operator among the number and mask created by us.Mask consists of 1 at the ith position and all other vacant spots are filled with zero . To achieve this mask we use left shi...00
AANSHinbitmanipulation.hashnode.dev·Aug 4, 2024 · 2 min readBit Manipulation: CORE CONCEPTSBit manipulation is a technique that involves directly manipulating the individual bits of a number. It's often used to optimize algorithms and solve problems efficiently. BITWISE OPERATORS Observations of XOR : a ^ 1 = ā (compliment of a) a ^ 0...00