🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.BFS
  2. B.DFS
  3. C.Dijkstra is required
  4. 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 →