GATE IT 2006 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0204

An array X of n distinct integers is interpreted as a complete binary tree. The index of the first element of the array is 0. The index of the parent of element\(X[i], i \neq 0\), is?
  1. A
    \(\left \lfloor \dfrac i 2 \right \rfloor\)
  2. B
    \(\left \lceil \dfrac{i-1}{2} \right \rceil\)
  3. C
    \(\left \lceil \dfrac i 2 \right \rceil\)
  4. D
    \(\left \lceil \dfrac i 2 \right \rceil - 1\)

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option D.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/3615/gate2006-it-71

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com