The Breadth First Search algorithm has been implemented using the queue data structure. Consider the undirected graph with vertices M, N, O, P, Q, R and the 7 edges M-N, M-Q, M-R, N-O, N-Q, O-P, P-Q.One possible order of visiting the nodes of the graph is
- AMNOPQR
- BNQMPOR
- CQMNPRO
- DQMNPOR