The data structure required for Breadth First Traversal on a graph is?
Asked In: BPSC TRE 3.0Options
- A. Queue
- B. Stack
- C. Array
- D. Tree
Quiz Practice:
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