A priority queue Q is used to implement a stack S that stores characters.…

GATE · 1997 · CS · Question 4 subparts

A priority queue Q is used to implement a stack S that stores characters. PUSH(C) is implemented as INSERT(Q, C, K) where K is an appropriate integer key chosen by the implementation. POP is implemented as DELETEMIN(Q). For a sequence of operations, the keys chosen are in

  1. A.

    Non-increasing order

  2. B.

    Non-decreasing order

  3. C.

    Strictly increasing order

  4. D.

    Strictly decreasing order

Attempted by 334 students.

Show answer

Correct answer: D

The worked solution is available to enrolled students.

Video solution available to enrolled students.

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

Loading lesson…