edited by
312 views
3 votes
3 votes

Which of the following statements is/are TRUE with respect to the time complexities of the graph algorithms to find Minimum Spanning Trees? (Mark all the appropriate choices)

  1. Kruskal's algorithm to find MST runs in $O(|E| \lg |V|)$
  2. Prim's algorithm to find MST implemented using binary min-heap runs in $O(|E| \lg |V|)$
  3. Prim's algorithm to find MST implemented using Fibonacci heap runs in $O(|E| + |V| \lg |V|)$
  4. If graph is given in adjacency list form, Prim's algorithm to find MST runs in $\Theta(V^2)$ using binary min-heap
edited by

1 Answer

2 votes
2 votes
Options A,B,C are true. Option D is false, as adjacency list is the best representation for Prim's algorithm and it gives time complexity as $O(|E| \lg |V|)$ using binary min-heap. With Adjacency matrix representation, Prim's algorithm using binary min-heap runs in $O(|V|^2\lg |V|)$ time as now processing the adjacency list for each vertex takes $O(|V|)$ time.
Answer:

Related questions