Union-find data structure

preview_player
Показать описание
How to implement a union-find (disjoint-sets) data structure in such a way that the UNION and FIND operations both take O(lg n) time.
Рекомендации по теме