A priority queue is implemented as a max-heap. Initially, it has five…

PYQ TCS NQT 2026

A priority queue is implemented as a max-heap. Initially, it has five elements. The level-order traversal of the heap is as follows: 20, 18, 15, 13, 12. Two new elements ‘10’ and ‘17’ are inserted into the heap in that order. What is the level-order traversal of the heap after the insertion of both elements?

  1. A.

    20, 18, 17, 15, 13, 12, 10

  2. B.

    20, 18, 17, 12, 13, 10, 15

  3. C.

    20, 18, 17, 10, 12, 13, 15

  4. D.

    20, 18, 17, 13, 12, 10, 15

Attempted by 57 students.

Sign up free to check your answer

Sign up free

Explore the full course: Cdac C Cat Complete Preparation

Loading lesson…