Child and Parent Operations
For each node
a in
A, if
a is located at index
i,
then:
- a's left child (if any) is stored in A[2i],
- a's right child (if any) is stored in A[2i+1],
and
- a's parent (if any) is stored in A[i/2], where "/"
is an integer divide operation (truncates any remainder)