In opposite to left shift, when we right shift a number we divide it
by a power of two. For example, 4 >> 2 = 0100
>> 2 = 0001 = 1 = 4 / 2^2. Here is the general formula:
a >> b = a / 2^b
Data structures, Algorithms, Coding, Technical Interview Questions and much more. (Still work in progress)
0 comments:
Post a Comment