Skip to content

ISRO Scientist/Engineer CSE 2017Algorithms › Design Techniques and Graph Algorithms

ISRO Scientist/Engineer CSE 2017 PYQ: Which of the following data structure is useful in traversing a given graph by breadth first search?

Which of the following data structure is useful in traversing a given graph by breadth first search?

  1. A
    Stack
  2. B
    Queue
    Correct answer
  3. C
    List
  4. D
    None of the above

Answer

(B) Queue

Approach

Recall the operational mechanism of breadth-first search (BFS): it explores a graph level by level, visiting all neighbors of a node before moving deeper. The data structure that naturally supports this first-in-first-out (FIFO) exploration order is the queue.

Reviewed by ISRO IQ Editorial Team.