Hacker News new | ask | show | jobs
by JamesUtah07 1422 days ago
Is there a name for the data structure/algorithm?
2 comments

It's called union-find, but also disjoint-set sometimes. The process of reparenting nodes is called path compression, and the optimization of using the larger set of the two as the parent when merging is usually just called "union by rank." Any of those terms should give you more details upon search.