All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · June 2024 Re-Exam

Match List I with List II
List IList II
(A) Dijkstra's Algorithm(I) Finds the shortest path between all pairs of vertices in a graph with positive or negative edge weights.
(B) Floyd-Warshall Algorithm(II) Finds the shortest path in a weighted graph with non-negative edge weights.
(C) Bellman-Ford Algorithm(III) Finds single-source shortest paths with possible negative weights.
(D) Prim's Algorithm(IV) Finds the Minimum Spanning Tree (MST).

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. (A)-(II), (B)-(I), (C)-(III), (D)-(IV)

Explanation

Dijkstra: single-source shortest paths with non-negative weights (II). Floyd-Warshall: all-pairs shortest paths, negative edges allowed (I). Bellman-Ford: single-source with possible negative weights (III). Prim: minimum spanning tree (IV).

More Data Structures and Algorithms questions