1.

Prim’s algorithm is a ______(a) Divide and conquer algorithm(b) Greedy algorithm(c) Dynamic Programming(d) Approximation algorithmI got this question in class test.My question is taken from Minimum Spanning Tree in chapter Minimum Spanning Tree of Data Structures & Algorithms II

Answer»

The correct CHOICE is (b) Greedy algorithm

Easiest 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.



Discussion

No Comment Found

Related InterviewSolutions