Question: 1. (25) [MST: Kruskal's algorithm tracing] Run the Kruskal's algorithm (shown below) implemented using disjoint sets against a graph shown below. Assume disjoint sets are

 1. (25) [MST: Kruskal's algorithm tracing] Run the Kruskal's algorithm (shown

1. (25) [MST: Kruskal's algorithm tracing] Run the Kruskal's algorithm (shown below) implemented using disjoint sets against a graph shown below. Assume disjoint sets are represented by a forest (i.e., set of trees). Use union-by-height heuristic when merging two trees, that is, connect the shorter tree as subtree of the longer tree. If the two tree heights are the same then connect the root node with the larger node number to the root node with the smaller number Apply path compression to provide a shortcut to the root after each Find operation. Show the resulting disjoint set tree structures at the end of each for-loop iteration (i.e., for each edge ei) Additionally, show the resulting minimum spanning tree after the algorithm terminates. Kruskal(G, c) \// c: set of edge weights Sort edges in an increasing order of weight c to ei,e2,...em- MakeUnionFind(V). for each edge ei in the sorted order Identify the two end nodes (u,v) of ei root l = Find(u). root2-Find(v) if (rootl + root2) Union(rootl, root2) return T 24 18 4 19 15 20

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!