Package pascal.taie.util.collection
Class UnionFindSet<E>
java.lang.Object
pascal.taie.util.collection.UnionFindSet<E>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCollection<Set<E>>
boolean
isConnected
(E e1, E e2) int
boolean
Unions the sets which e1 and e2 belong to, respectively.
-
Constructor Details
-
UnionFindSet
-
-
Method Details
-
union
Unions the sets which e1 and e2 belong to, respectively.- Returns:
true
if this union-find set changed as a result of this call.
-
isConnected
- Returns:
true
if e1 and e2 belong to the same set.
-
findRoot
- Returns:
- the root element of the set which e belongs to.
-
numberOfSets
public int numberOfSets()- Returns:
- number of disjoint sets in this union-find set.
-
getDisjointSets
- Returns:
- a collection of all disjoint sets in this union-find set.
-