31. Union-find
Given a set of elements, it is often useful to partition them into a number of separate, nonoverlapping groups. A disjoint-set data structure is a data structure that keeps track of such a partitioning. A union-find algorithm is an algorithm that performs two useful operations on such a data structure:
Find: Determine which group a particular element is in.
Union: Combine or merge two groups into a single group.
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。