1.

Which of the following is false about the Kruskal’s algorithm?(a) It is a greedy algorithm(b) It constructs MST by selecting edges in increasing order of their weights(c) It can accept cycles in the MST(d) It uses union-find data structureThe question was posed to me in unit test.Question is from Minimum Spanning Tree topic in division Minimum Spanning Tree of Data Structures & Algorithms II

Answer»

Right answer is (C) It can accept cycles in the MST

For explanation: KRUSKAL’s algorithm is a greedy algorithm to construct the MST of the given graph. It constructs the MST by selecting EDGES in increasing ORDER of their weights and rejects an edge if it may form the cycle. So, using Kruskal’s algorithm is never formed.



Discussion

No Comment Found

Related InterviewSolutions