1.

Prim’s algorithm resemblesDijkstra’s algorithm.(a) True(b) FalseI had been asked this question in quiz.Question is from Minimum Spanning Tree in division Minimum Spanning Tree of Data Structures & Algorithms II

Answer» CORRECT answer is (a) True

Best EXPLANATION: In Prim’s ALGORITHM, the MST is CONSTRUCTED starting from a single vertex and adding in new edges to the MST that link the partial tree to a new vertex outside of the MST. And Dijkstra’s algorithm also rely on the SIMILAR approach of finding the next closest vertex. So, Prim’s algorithm resembles Dijkstra’s algorithm.


Discussion

No Comment Found

Related InterviewSolutions