1.

Consider the following graph. Using Kruskal’s algorithm, which edge will be selected first?(a) GF(b) DE(c) BE(d) BGThis question was addressed to me in an internship interview.This intriguing question comes from Minimum Spanning Tree topic in section Minimum Spanning Tree of Data Structures & Algorithms II

Answer»

The correct OPTION is (c) BE

Explanation: In Krsuskal’s algorithm the edges are selected and added to the SPANNING tree in increasing ORDER of their weights. THEREFORE, the first EDGE selected will be the minimal one. So, correct option is BE.



Discussion

No Comment Found

Related InterviewSolutions