An array X of n distinct integers is interpreted as a complete binary tree. If…
GATE · 2006 · IT
An array X of n distinct integers is interpreted as a complete binary tree. If the first array index is 0, what is the parent index of element X[i] for i ≠ 0?
- A.
⌊i / 2⌋
- B.
⌈(i - 1) / 2⌉
- C.
⌈i / 2⌉
- D.
⌈i / 2⌉ - 1
Attempted by 591 students.
Sign up free to check your answer
Sign up freeLoading lesson…