×

Multiple-Choice Questions

The time complexity of the Floyd-Warshall algorithm is ______.

29. The time complexity of the Floyd-Warshall algorithm is ______.

  1. O(V^2)
  2. O(V^2 + E)
  3. O(V^3)
  4. O(E^3)

Answer

The correct answer is: C) O(V^3)

Explanation

The Floyd-Warshall algorithm has a time complexity of O(V^3) due to its three nested loops over the graph vertices.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.