I am reading about Heaps, which describes that you can do the operations of accessing the left child, the RIGHT/LEFT child and the PARENT with bit shift operations. While Left and Parent seems trivial i am not sure with the right one. Do i just have to add one?
Here is an excerpt from the book: MIT Introduciton to algorithms:
"Similarly, the RIGHT procedure can quickly compute 2i + 1 by shifting the binary representation of i left by one bit position and then adding in a 1 as the low-order bit".
Access Operations:
LEFT: 2*i
i<<1
RIGHT: 2*i+1
(i<<1)+1
PARENT: i/2
i>>1