Methods
(static) get(object) → {String}
Find and return the name of the set containing the object.
Parameters:
Name | Type | Description |
---|---|---|
object |
Any
|
Returns:
- Type:
-
String
(static) groups() → {Iterator}
Iterates over the sets stored in this structure.
Returns:
- Type:
-
Iterator
Example
partition = UnionFind( 1, 2, 3 )
partition.groups() --> [ 1 ], [ 2 ], [ 3 ]
partition.union( 1, 2 )
partition.groups() --> [ 1, 2 ], [ 3 ]