Match List I with List II. List I: A. Topological sort of a DAG, B. Kruskal's MST algorithm, C. Bellman-Ford single-source shortest path, D. Floyd-Warshall all-pairs shortest path. List II: I. O(V + E), II. O(VE), III. θ(V + E), IV. θ(V³).
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. A-III, B-I, C-II, D-IV
Explanation
Topological sort is Θ(V + E), Bellman–Ford O(VE), Floyd–Warshall Θ(V³), leaving O(V + E) for Kruskal in the key's matching.
Note: Kruskal's algorithm actually runs in O(E log V); the official key pairs it with O(V + E).
More Data Structures and Algorithms questions
- Consider the undirected graph below: Using Prim's algorithm to construct a minimum spanning tree starting with node a, which one of the fol…
- G T Let be a simple undirected graph, D be a DFS G T tree on , and B be the BFS tree on G. Consider the following statements. G Statement I…
- The weight of minimum spanning tree in graph G, calculated using Kruskal's algorithm is :
- What is the worst case running time of Insert and Extract-min, in an implementation of a priority queue using an unsorted array? Assume tha…
- In a B-Tree, each node represents a disk block. Suppose one block holds 8192 bytes. Each key uses 32 bytes. In a B-tree of order M there ar…
- Give tight bounds for T(n) = 4T(√n) + lg²n, with T(n) constant for n ≤ 2.