🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Shortest Paths: all 10 questions

Quiz: Shortest Paths · Question 10 of 10

What is the time complexity of Bellman-Ford?

What is the time complexity of Bellman-Ford?

  1. A.O(V + E)
  2. B.O(V · E)
  3. C.O(E log V)
  4. D.O(V³)
Answer & explanation

Correct answer: O(V · E)

It relaxes all E edges in each of V − 1 rounds.

Can you get the rest right without peeking?

Take the timed Quiz: Shortest Paths quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →