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

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

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^2)

  4. D.

    O(n^3)

Attempted by 17 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…