Question: 15. (6 points) Consider the array S -1,0,1,2,3,4,5,6). Show the set of disjoint sets (that is, the forest of trees), encoded by S. Suppose the
15. (6 points) Consider the array S -1,0,1,2,3,4,5,6). Show the set of disjoint sets (that is, the forest of trees), encoded by S. Suppose the find operation uses path compression. What is the resulting configuration of S (show array and forest of trees) after performing the operation S,find.c(5) 16. (6 points) Consider the following code fragnent where S is used to represent a disjoint set forest. Show the configuration of S after the code is executed. for (int i-1;1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
