GATE / CS ARCHIVE

GATE CSE 2000 / QUESTION 1.13

Algorithm and data-structure matching

Data Structures · Stacks & Queues · Full GATE CSE 2000 paper

GATE 2000, Q1.13 1 mark · MCQ
Report issue

Stacks & Queues

Question 1.13, GATE 2000: Match X depth-first search,Y breadth-first search,Z sorting to 1 heap,2 queue,3 stack.
Question 1.13, GATE 2000: Match X depth-first search,Y breadth-first search,Z sorting to 1 heap,2 queue,3 stack.
Tap to enlarge
Your answer
Answer & solution

Answer: C: X3,Y2,Z1 (no official key was published)

Step 1: DFS must return to the latest unfinished branch, a last-in-first-out behavior implemented by an explicit stack or recursive call stack. Thus X→3.

Step 2: BFS processes older discovered vertices first, using a FIFO queue, so Y→2. A heap supports repeated minimum/maximum extraction for sorting, so Z→1.

Together these matches give C. The sorting match refers to heap sort, not to every possible sorting algorithm.

Original paper, page 2