Questions: Breadth-First Search (BFS)

3 questions to test your understanding

Score: 0 / 3
Question 1 Multiple Choice

Which data structure is central to BFS and explains why it explores a graph layer by layer?

AStack
BQueue
CPriority queue
DHash map
Question 2 True / False

BFS finds the shortest weighted path between two nodes in any graph.

TTrue
FFalse
Question 3 Short Answer

Why must a node be marked as visited before it is enqueued, rather than after it is dequeued?

Think about your answer, then reveal below.