The data structure required for Breadth First Traversal on a graph is?
Options
- A. Queue
- B. Stack
- C. Array
- D. Tree
A. Queue
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.
Stack → Used in DFS (Depth First Search)
Array → Just storage, not traversal control
Tree → A data structure, not used to control BFS
Attempt Quiz Now:
BPSC Tre 4.0 DSA Practice Set