Examveda

How does the BFS algorithm ensure that the shortest path is found in an unweighted graph?

A. By exploring nodes as deeply as possible.

B. By randomly visiting nodes.

C. By exploring all nodes at the current level before moving to the next level.

D. By following the shortest edge.

Answer: Option C


Join The Discussion

Related Questions on Graph Algorithms (DFS, BFS, Dijkstras, etc)