Question: Suppose we are using union - by - size but not path compression in our disjoint set implementation and have 2 ^ nitems 1 ,
Suppose we are using unionbysize but not path compression in our disjoint set
implementation and have nitems n initially each in its own set.
a Find a set of n unions that lead to the worstcase ie largest average depth in the final tree for n Do the same for n Be sure to specify the average depth for
each of your trees.
b Let Dn the worst case average depth when combing n items using n unions.
Find a closed expression for Dn and prove it is correct. HINT: Two approaches to this problem are the following: derive a recurrence relation for Dn and solve it or guess an answer for Dn using the two examples in part a and prove its correct using induction.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
