Computer
Which traversal algorithm is used in the breadth-first search (BFS) of a graph?
Show answer
Correct answer: A) Level-order traversal
BFS uses level-order traversal, visiting all nodes at the current depth before moving to the next level.It explores neighbors layer by layer.This making it suitable for shortest path finding in unweighted graphs.
Explanation
BFS uses level-order traversal, visiting all nodes at the current depth before moving to the next level.It explores neighbors layer by layer.This making it suitable for shortest path finding in unweighted graphs.