Match List I with List II
| List I | List 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
- Arrange the following steps in the correct order to solve the Knapsack problem using Dynamic Programming. (A) Define the base case when the…
- Match List I (Recurrence Relation) with List II (Complexity)List I List II (A) T(n) = 2T(n/2) + n (I) T(n) = Θ(n log n) {exact solution} (B…
- Which of the following is NOT a palindromic subsequence of the string "ababcdabba"?
- Which of the following is TRUE?
- What is the result of evaluating the postfix expression "4 3 * 2 5 * + 8 -"?
- Which data structure is typically used to implement a hash table?