Vidyalelo
Data Structure · Q14

Graphs

Programming · Data Structure · question 14

Q14

How does the Floyd-Warshall algorithm compute shortest paths in a graph?

A.
By applying dynamic programming only once.
B.
By performing DFS from each vertex.
C.
By considering all pairs of vertices and iteratively updating shortest paths.
Answer
D.
By using a priority queue for edge relaxation.

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board