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

  1. A.

    ⌊log2 i⌋

  2. B.

    ⌈log2 (i + 1)⌉

  3. C.

    ⌊log2 (i + 1)⌋

  4. D.

    ⌈log2 i⌉

Attempted by 520 students.

Show answer

Correct answer: C

The worked solution is available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…