🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Closures and Warshall's Algorithm: all 10 questions

Quiz: Closures and Warshall's Algorithm · Question 7 of 10

What is the time complexity of Warshall's algorithm on n elements?

What is the time complexity of Warshall's algorithm on n elements?

  1. A.O(n)
  2. B.O(n²)
  3. C.O(n³)
  4. D.O(2ⁿ)
Answer & explanation

Correct answer: O(n³)

Three nested loops over k, i and j.

Can you get the rest right without peeking?

Take the timed Quiz: Closures and Warshall's Algorithm quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →