Match List 1 with List 2 and choose the correct answer from the code given below: List I (Graph Algorithm) List II (Time Complexity) a) Dijkstra’s algorithm i) Θ(E log E) b) Kruskal’s algorithm ii) Θ(V 3) c) Floyd-Warshall algorithm iii) Θ(V 2) d) Topological sorting iv) Θ(V + E) Where V and E are the number of vertices and edges in graph respectively.
(a)-(iii), (b)-(i), (c)-(ii), (d)-(iv)
The question asks us to match standard graph algorithms with their typical time complexities. Understanding the efficiency of these algorithms is crucial in computer science and graph theory.
Let's analyze each algorithm and its time complexity:
Based on the analysis, the correct matches are:
Let's check the given options against our findings:
| Algorithm | Matches with Complexity |
|---|---|
| (a) Dijkstra’s | (iii) $\Theta(V^2)$ |
| (b) Kruskal’s | (i) $\Theta(E \log E)$ |
| (c) Floyd-Warshall | (ii) $\Theta(V^3)$ |
| (d) Topological sorting | (iv) $\Theta(V + E)$ |
Comparing this with the provided options, we look for the one that matches (a)-(iii), (b)-(i), (c)-(ii), (d)-(iv).
Option 3 is (a)-(iii), (b)-(i), (c)-(ii), (d)-(iv).
| Graph Algorithm | List II Complexity | Description |
|---|---|---|
| Dijkstra’s algorithm | $\Theta(V^2)$ or $\Theta(E\log V)$ | Single-source shortest paths (non-negative weights). $\Theta(V^2)$ is common for adjacency matrix or simple priority queue. |
| Kruskal’s algorithm | $\Theta(E \log E)$ or $\Theta(E \log V)$ | Minimum Spanning Tree. Dominated by edge sorting. |
| Floyd-Warshall algorithm | $\Theta(V^3)$ | All-pairs shortest paths (allows negative weights, but no negative cycles). Dynamic programming approach. |
| Topological sorting | $\Theta(V + E)$ | Linear ordering of vertices in a DAG. Based on DFS or in-degrees. |
Time complexity is a measure of how the running time of an algorithm increases with the size of the input. For graph algorithms, the input size is typically represented by the number of vertices ($V$) and the number of edges ($E$).
In the following table, the left column contains the names of standard graph algorithms and the right column contains the time complexities of the algorithms. Here, n and m are number of vertices and edges, respectively. Match each algorithm with its time complexity.
| List I | List II | ||
| Standard graph algorithms | Time complexities | ||
| A. | Bellman‐Ford algorithm | I. | O(m*log n) |
| B. | Kruskal’s algorithm | II. | O(n 3) |
| C. | Floyd‐Warshall algorithm | III. | O(n*m) |
| D. | Topological sorting | IV. | O(n + m) |
Choose the correct answer from the options given below :
How many cards must be selected from a standard deck of 52 cards to guarantee that at least three hearts are present among them?
The solution of recurrence relation: T(n)=2T(sqrt(n)) + lg(n) is
Modulus of elasticity of concrete, E is calculated using:
In how many types can R.C.C. be classified into?