Question: One alternative to path compression that gives similar performance gains is called path halving. In path halving, when the path is traversed from the node
One alternative to path compression that gives similar performance gains is called path halving. In path halving, when the path is traversed from the node to the root, we make the grandparent of every other node i on the path the new parent of i. Write a version of FIND that implements path halving. Your FIND operation should work as you move up the tree, rather than require the two passes needed by path compression.
Step by Step Solution
3.51 Rating (168 Votes )
There are 3 Steps involved in it
Understanding Path Halving in Disjoint Set Union DSU Path halving is an alternative to path compression that offers similar performance gains in Disjo... View full answer
Get step-by-step solutions from verified subject matter experts
