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 566 students.
Show answer
Correct answer: D
Explore the full course: Iocl Engineers Officers Grade A Paper 2
Loading lesson…