#include <fastset.h>
Inheritance diagram for ABA_FASTSET:
Public Member Functions | |
ABA_FASTSET (ABA_GLOBAL *glob, int size) | |
bool | unionSets (int x, int y) |
Private Attributes | |
ABA_ARRAY< int > | rank_ |
rank_ | The rank of each set. |
Definition at line 42 of file fastset.h.
ABA_FASTSET::ABA_FASTSET | ( | ABA_GLOBAL * | glob, | |
int | size | |||
) |
The constructor.
At the beginning each possible set receives the rank 0.
glob | A pointer to the corresponding global object. | |
size | Only integers between 0 and size-1 can be inserted in the set. |
bool ABA_FASTSET::unionSets | ( | int | x, | |
int | y | |||
) |
Unites the sets x and y.
It differs from the function unionSets() of the base class ABA_SET such that the tree with smaller rank is attached to the one with larger rank. Therefore, x is no more guaranteed to be the representative of the joint set.
false otherwise.
x | An element of the first set of the union operation. | |
y | An element in the second set of the union operation. |
Reimplemented from ABA_SET.
ABA_ARRAY<int> ABA_FASTSET::rank_ [private] |