Home »
MCQs »
Algorithms MCQs
Which of the following statements is true about the Floyd-Warshall algorithm?
30. Which of the following statements is true about the Floyd-Warshall algorithm?
- It uses a greedy approach.
- It uses dynamic programming.
- It only works with unweighted graphs.
- It can only find the shortest path for a single source.
Answer
The correct answer is: B) It uses dynamic programming.
Explanation
The Floyd-Warshall algorithm follows a dynamic programming approach to find the shortest paths between all pairs of nodes.