Similar questions 1 more →
Graph Algorithms

Your answer
Answer & solution
Answer: C (no official key was published)
Step through it (4 options)
1. BFS uses a FIFO queue, so all newly discovered neighbors enter behind previously queued vertices. Start at Q and discover M,N,P in that order.
2. Processing M next discovers R. Processing N then discovers O. Processing P adds nothing because O is already discovered.
3. The dequeue/visit order is Q,M,N,P,R,O, C. D puts O before R despite the specified first-layer order; the other offered orders violate BFS layers.