The Floyd–Warshall algorithm is a popular method for solving the All-Pair…

Bihar STET · PGT (Paper 2) · Computer Science · 2025

The Floyd–Warshall algorithm is a popular method for solving the All-Pair Shortest Paths problem. What is the time complexity of the Floyd–Warshall algorithm for a graph with 'n' vertices?

  1. A.

    O(n)

  2. B.

    O(n log n)

  3. C.

    O(n²)

  4. D.

    O(n³)

Attempted by 215 students.

Show answer

Correct answer: D

The worked solution is available to enrolled students.

Explore the full course: Bihar Stet Paper Ii Computer Science

Loading lesson…