# Prim’s Algorithm Multiple choice Questions and Answers (MCQs)

## Click on any option to know the CORRECT ANSWERS

 Question 1
Which of the following is true?
 A Prim's algorithm initialises with a vertex B Prim's algorithm initialises with a edge C Prim's algorithm initialises with a vertex which has smallest edge D Prim's algorithm initialises with a forest

Question 1 Explanation:
Steps in Prim's algorithm: (I) Select any vertex of given graph and add it to MST (II) Add the edge of minimum weight from a vertex not in MST to the vertex in MST; (III) It MST is complete the stop, otherwise go to step (II).

 Question 2
Consider the given graph.

What is the weight of the minimum spanning tree using the Prim's algorithm, starting from vertex a?

 A 23 B 28 C 27 D 11

 Question 3
Worst case is the worst case time complexity of Prim's algorithm if adjacency matrix is used?
 A O(log V) B O(V2) C O(E2) D O(V log E)

Question 3 Explanation:
Use of adjacency matrix provides the simple implementation of the Prim's algorithm. In Prim's algorithm, we need to search for the edge with a minimum for that vertex. So, worst case time complexity will be O(V2), where V is the number of vertices.

 Question 4
Prim's algorithm is a .....
 A Divide and conquer algorithm B Greedy algorithm C Dynamic Programming D Approximation algorithm

Question 4 Explanation:
Prim's algorithm uses a greedy algorithm approach to find the MST of the connected weighted graph. In greedy method, we attempt to find an optimal solution in stages.

 Question 5
Prim's algorithm resembles Dijkstra's algorithm.
 A True B False