Step 2:
For BFS, the neighbors are considered in alphabetical order. So, for vertex a, the neighbors are b, c, and d. For vertex b, the neighbors are a, c, and e. For vertex c, the neighbors are a, b, d, and e. For vertex d, the neighbors are a, c, and f. For
Show more…