← Graphs Quiz: all 8 questions
Graphs Quiz · Question 2 of 8
Which algorithm finds the fewest steps between two nodes in an UNWEIGHTED graph?
Which algorithm finds the fewest steps between two nodes in an UNWEIGHTED graph?
- A.BFS
- B.DFS
- C.Dijkstra is required
- D.Binary search
Answer & explanation
Correct answer: BFS
BFS explores nodes in increasing distance, so the first time it reaches the target is the shortest path.
Can you get the rest right without peeking?
Take the timed Graphs Quiz quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →