Breadth-First Search (BFS) of a graph uses which auxiliary data structure?
- A Stack
- B Queue
- C Priority queue
- D Hash table
Explanation
BFS visits vertices level by level and keeps the frontier in a queue so vertices are processed in the order they were discovered.