Union by rank technique

Home > Computer Science > Algorithms and data structures > Disjoint Set Union > Union by rank technique

This is another optimization technique used in Union-Find algorithm to improve the time complexity of the union operation. It involves attaching the shorter tree to the root of the taller tree, based on the rank of the trees.