1. Home
  2. Computer Science MCQs
  3. Algorithms and Data Structures
  4. Which data structure is used to implement breadth-first…

Added 2 Nov 2026

Which data structure is used to implement breadth-first search (BFS) on a graph?

  1. Hash set
  2. Heap
  3. Stack
  4. Queue Correct answer

Correct answer

D. Queue

29 views

MCQSEXAM

Explanation

BFS uses a FIFO queue to visit nodes level by level, which finds shortest paths in unweighted graphs. Depth-first search uses a stack or recursion.

Reference

Asked in: GATE CS, NTS, Technical Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Algorithms and Data Structures MCQs

Practise all Algorithms and Data Structures MCQs

Similar MCQs