Add a value to this datastructure
Add a value to this datastructure
Value to be added
New DisjointSets's state.
Checks whether or not a value is present in the disjoint sets collection
Checks whether or not a value is present in the disjoint sets collection
label to be found within the data structure
Check result
Find the label of the provided value.
Find the label of the provided value.
Value whose label is to be found
(new state, 'None' if the value doesn't exist, Some(label) otherwise)
Generates a map from labels to sets from the current DisjointSets.
Joins two disjoint sets if both are contained by this DisjointSets
Joins two disjoint sets if both are contained by this DisjointSets
Set a
Set b
(new DisjointSets with updated state,
true
if Both labels are contained and joined
)