Q.

Which of the following is true?

A. prim’s algorithm can also be used for disconnected graphs
B. kruskal’s algorithm can also run on the disconnected graphs
C. prim’s algorithm is simpler than kruskal’s algorithm
D. in kruskal’s sort edges are added to mst in decreasing order of their weights
Answer» B. kruskal’s algorithm can also run on the disconnected graphs
Explanation: prim’s algorithm iterates from one node to another, so it can not be applied for disconnected graph. kruskal’s algorithm can be applied to the disconnected graphs to construct the minimum cost forest. kruskal’s algorithm is comparatively easier and simpler than prim’s algorithm.
1.9k
0
Do you find this helpful?
9

Discussion

No comments yet