An array X of n distinct integers is interpreted as a complete binary tree.…

PYQ GATE 2006

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 only the root node does not satisfy the heap property, the algorithm to convert the complete binary tree into a heap has the best asymptotic time complexity of

  1. A.

    O (n)

  2. B.

    O (log n)

  3. C.

    O (nlog n)

  4. D.

    O (n log log n)

Attempted by 631 students.

Sign up free to check your answer

Sign up free

Explore the full course: Data Structures

Loading lesson…