In BFS, what is the order in which nodes are visited?

  • Breadth-first
  • Depth-first
  • Random order
  • Topological order
BFS (Breadth-First Search) visits nodes in a breadth-first order, exploring all the neighbors of a node before moving on to the next level of nodes. This ensures that nodes closer to the starting node are visited before nodes farther away, creating a level-by-level exploration of the graph.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *