Question: Consider the Quick Union Weighted Union-Find algorithm. Let the set be {1.16} and consider the following Union operations. Each Union is indicated as (m, n)

 Consider the Quick Union Weighted Union-Find algorithm. Let the set be

Consider the Quick Union Weighted Union-Find algorithm. Let the set be {1.16} and consider the following Union operations. Each Union is indicated as (m, n) meaning the Union of the sets containing m and n respectively. If m and n are already in the same set, no Union takes place. A union operation (m, n) is always preceded by Find (m) and Find (n) which return the roots of the trees representing the set that contains m and the set that contain n. As you do the Unions, account for the costs of these Find operations. A Find (m) costs 1 if the tree is just the root m; 2 if the node m is a child of the root of the tree; 3 if it is a child of a child of the root, and so on... When performing the Union of two sets of equal size link the root of the first tree to the second. a) perform the Union and Finds indicated. Keep track of the cost of all finds. Show the final forest of trees that results, Compute the rank of each node, and the group number of each node. Note that ranks and group numbers are computed on the forest that results of Quick Union Weighted. Mark rank numbers in red and group numbers in green on the final forest, and give the exact cost of all finds, and the total cost for all the finds. Unions: (1, 2) (3, 4) (5, 6) (7, 8) (9, 10) (11, 12) (13, 14) (15, 16); (2, 4) (6, 8) (10, 12) (14, 16); (1, 7) (9, 13); (1, 9) b) redo the same Unions and finds using Quick Union Weighted with Path Compression, but show the result of path compression after each find. Again, keep track of exact costs of all finds. What is the total cost for all the finds

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!