GATE IT 2006 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0202

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. If the root node is at level 0, the level of element \(X[i], i \neq 0\), is
  1. A
    \(\left \lfloor \log _2 i \right \rfloor\)
  2. B
    \(\left \lceil \log _2 (i+1)\right \rceil\)
  3. C
    \(\left \lfloor \log _2 (i+1) \right \rfloor\)
  4. D
    \(\left \lceil \log _2 i \right \rceil\)

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

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

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