One alternative to path compression that gives similar performance gains is called path halving. In path halving,
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 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.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Practical Introduction To Data Structures And Algorithm Analysis Java Edition
ISBN: 9780136609117
1st Edition
Authors: Clifford A. Shaffer
Question Posted: