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 543 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…