Question: Suppose we implement the tree-based union-find data structure using the unionby-size heuristic and a partial path-compression heuristic. The partial path compression in this case means
Suppose we implement the tree-based union-find data structure using the unionby-size heuristic and a partial path-compression heuristic. The partial path compression in this case means that, after performing a sequence of pointer hops for a find operation, we update the parent pointer for each node u along this path to point to its grandparent. Show that the total running time for performing m union and find operations, starting with n singleton sets, is still O((n+m)α(n)) in this case.
Step by Step Solution
3.38 Rating (170 Votes )
There are 3 Steps involved in it
The running time for a unionfind data structure using the unionbysize heuristic and p... View full answer
Get step-by-step solutions from verified subject matter experts
