Which graph traversal algorithm uses a queue?
17 views
- Depth First Search
- Breadth First Search (Correct Answer)
- Dijkstra’s Algorithm
- Prim’s Algorithm
Explanation
BFS uses a queue to explore nodes level by level. It ensures that nodes are visited in increasing order of distance from the source, making it suitable for shortest path in unweighted graphs.