I just studied the data structure of disjoint sets, and I know that it is also called “union-based data structures,” union and search are the two main operations of this data structure. We can perform the union on disjoint sets, similarly we can perform search operations; I want to know what other operations we can perform on disjoint sets, except for union and search.
The structure of unconnected sets is also called the find-union structure. Therefore, operations union, findand MakeSetshould be supported. Other operations are not what this structure is about, and whether they are supported depends on the implementation and goals that you have. Sometimes you need to choose a specific implementation specifically to suit your projects with additional actions.
union
find
MakeSet
In addition, it would be nice if we supported other basic operations related to the set. Let me list them:
, . , - , ( ) :
o [set1] o [Set2] / \ \ o o o / o
, , , set 1; , node. , , .
:
, ; , (O (1)); - . , [binary], , , O (log n).
The point of disjoint structure of the union does not depend on the performance of elementary typing operations, as your question and other respondents seem to be. Instead, we are talking about a highly efficient implementation of a structure that needs certain algorithms. In particular, the discovery of connected components and minimal spanning trees creates their most effective implementations on top of disjoint union sets.