An array X of n distinct integers is interpreted as a complete binary tree.…
GATE · 2006 · IT
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 ≠ 0, is
- A.
⌊log2 i⌋
- B.
⌈log2 (i + 1)⌉
- C.
⌊log2 (i + 1)⌋
- D.
⌈log2 i⌉
Attempted by 520 students.
Show answer
Correct answer: C
Explore the full course: Iocl Engineers Officers Grade A Paper 2
Loading lesson…