List of all members.
Public Member Functions |
TInt & | Parent (const int &Key) |
| Returns the parent of element Key.
|
TInt & | Rank (const int &Key) |
| Returns the rank of element Key.
|
| TUnionFind () |
| TUnionFind (const int &ExpectKeys) |
| Constructor that reserves enough memory for ExpectKeys elements.
|
| TUnionFind (const TUnionFind &UnionFind) |
TUnionFind & | operator= (const TUnionFind &UF) |
int | Len () const |
| Returns the number of elements in the structure.
|
bool | IsKey (const int &Key) const |
| Returns true if the structure contains element Key.
|
int | GetKeyI (const int &KeyN) const |
| Returns the element KeyN.
|
int | Find (const int &Key) |
| Returns the set that contains element Key.
|
int | Add (const int &Key) |
| Adds an element Key to the structure.
|
void | Union (const int &Key1, const int &Key2) |
| Merges sets with elements Key1 and Key2.
|
bool | IsSameSet (const int &Key1, const int &Key2) |
| Returns true if elements Key1 and Key2 are in the same set.
|
void | Dump () |
| Prints out the structure to standard output.
|
Detailed Description
Union Find class (Disjoint-set data structure). For more info see: http://en.wikipedia.org/wiki/Disjoint-set_data_structure)
Constructor & Destructor Documentation
Constructor that reserves enough memory for ExpectKeys elements.
Member Function Documentation
Adds an element Key to the structure.
Prints out the structure to standard output.
Returns the set that contains element Key.
Returns the element KeyN.
Returns true if the structure contains element Key.
Returns true if elements Key1 and Key2 are in the same set.
Returns the number of elements in the structure.
Returns the parent of element Key.
Returns the rank of element Key.
Merges sets with elements Key1 and Key2.
The documentation for this class was generated from the following files: