Skip to content
Sign in
Computer

Which traversal algorithm is used in the breadth-first search (BFS) of a graph?

Tap an option to check the answer. You can also press A–D.

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.