#include <disjoint_set.hpp>
|
| DisjointSet (int size) |
| Construct a new Disjoint Set object.
|
|
int | find (int p) |
| Find the set containing element 'p'.
|
|
void | unionSets (int p, int q) |
| Union the sets containing elements 'p' and 'q'.
|
|
int | getCount () const |
| Get the number of distinct sets.
|
|
◆ DisjointSet()
hsc_snippets::DisjointSet::DisjointSet |
( |
int | size | ) |
|
|
inlineexplicit |
Construct a new Disjoint Set object.
- Parameters
-
size | The number of elements in the set. |
◆ find()
int hsc_snippets::DisjointSet::find |
( |
int | p | ) |
|
|
inline |
Find the set containing element 'p'.
- Parameters
-
- Returns
- The set containing element 'p'.
◆ getCount()
int hsc_snippets::DisjointSet::getCount |
( |
| ) |
const |
|
inline |
Get the number of distinct sets.
- Returns
- The number of distinct sets.
◆ unionSets()
void hsc_snippets::DisjointSet::unionSets |
( |
int | p, |
|
|
int | q ) |
|
inline |
Union the sets containing elements 'p' and 'q'.
- Parameters
-
p | The first element. |
q | The second element. |
The documentation for this class was generated from the following file: