Which data structure does breadth-first search (BFS) use to keep track of vertices still to be explored?
Correct answer D. Queue
Explanation
BFS explores all neighbours of a vertex before moving deeper, so vertices must be processed in the order they were discovered, which is FIFO. A queue provides exactly that. Using a stack instead turns the traversal into depth-first search. In an unweighted graph, BFS from a source therefore finds the paths with the fewest edges.
Answer checked How we write and check questions
Discussion