
Bit Manipulation Tricks for interviews
Right shift operator is equivalent to division by 2.
You can divide a number by 2 by using the >> operator.
Example :
16 = 00010000 in binary format
00010000 >> 1 = 00001000
00001000 = 8 in decimal format = 16 / 2
PS : x >> y is equivalent to dividing x