When merging two components in a disjoint-set data structure, attach the representative of the smaller component to that of the larger one. Each time an element's depth increases its component size at least doubles, so its depth is logarithmically bounded even before path compression is applied.
Articles by others on the same topic
There are currently no matching articles.