The data structure required for Breadth First Traversal on a graph is?

Options

  • A. Queue
  • B. Stack
  • C. Array
  • D. Tree

Correct Answer (Detailed Explanation is Below)

A. Queue

Detailed Explanation

Breadth First Search (BFS) works level by level.

  • First, it visits the starting node.

  • Then it visits all its neighbors.

  • Then neighbors of neighbors.

To maintain this order (FIFO – First In First Out), we use a Queue.

 Why not others?

  • Stack → Used in DFS (Depth First Search)

  • Array → Just storage, not traversal control

  • Tree → A data structure, not used to control BFS

OOps! You are currently offline.