GATE CS 1997 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0258

A priority queue Q is used to implement a stack 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

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option D.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/2248/gate1997-4-7

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com