# Takes a connected undirected graph (G) and a cost table (Edge-Costs)# Returns a set of edges E' such that (V(G), E') is # a MST (minimum spanning tree).MST-Kruskal(G,Edge-Costs)1V=V(G)2E=E(G)3Sets=Make-Array(Length(V))4E' = {}5forvinV6Sets[v]=Make-Set()# Sort the edges by increasing cost, using the# cost-table Edge-Costs.7Sort(E)8for(u,v)inE9ifFind-Set(u)!=Find-Set(v)10E' = E'∪{(u,v)}11Union(Sets[u],Sets[v])12returnE'