Dynamic Set Forests Visualization

Dynamic Set Forests are a collection of trees used to represent disjoint sets. Each tree represents a set, with the root node as the representative. This visualization demonstrates the union and find operations with both union by rank and path compression optimizations.

Dynamic Set Forest Visualization

Operation Explanation

Select an operation and enter value(s) to see the explanation here.

Time Complexity:

Operation Without Optimizations With Union by Rank & Path Compression
Make Set O(1) O(1)
Find O(n) O(α(n))
Union O(n) O(α(n))

Note: α(n) is the inverse Ackermann function, which grows very slowly.