disjoint set class
More...
#include <disjoint_set.h>
|
| dsu (int64_t n) |
| Construct a new dsu object.
|
|
int64_t | find (int64_t i) |
| find function
|
|
void | join (int64_t i, int64_t j) |
| join function
|
|
bool | same (int64_t i, int64_t j) |
| same function
|
|
std::vector< int64_t > | get (int64_t i) |
|
int64_t | size (int64_t i) |
| size function
|
|
int64_t | get_max (int64_t i) |
| get the maximum element of the set that i exists in
|
|
int64_t | get_min (int64_t i) |
| get the minimum element of the set that i exists in
|
|
◆ dsu()
Construct a new dsu object.
- Parameters
-
◆ find()
int64_t dsu::find |
( |
int64_t | i | ) |
|
|
inline |
find function
- Parameters
-
i | the element we want to search |
- Returns
- int64_t the set it exists in
◆ get_max()
int64_t dsu::get_max |
( |
int64_t | i | ) |
|
|
inline |
get the maximum element of the set that i exists in
- Parameters
-
i | the object that we want to search for |
- Returns
- int64_t the maximum element
◆ get_min()
int64_t dsu::get_min |
( |
int64_t | i | ) |
|
|
inline |
get the minimum element of the set that i exists in
- Parameters
-
i | the object that we want to search for |
- Returns
- int64_t the minimum element
◆ join()
void dsu::join |
( |
int64_t | i, |
|
|
int64_t | j ) |
|
inline |
join function
- Parameters
-
i | first element |
j | second element union of i and j |
◆ same()
bool dsu::same |
( |
int64_t | i, |
|
|
int64_t | j ) |
|
inline |
same function
- Parameters
-
i | first element |
j | second element |
- Returns
- true if i and j exists in the same set
-
false if i and j does not exist in the same set
◆ size()
int64_t dsu::size |
( |
int64_t | i | ) |
|
|
inline |
size function
- Parameters
-
i | element we are looking for |
- Returns
- int64_t the size of the set that i exists in
The documentation for this class was generated from the following file:
- /Users/spirosmag/Documents/AlgoPlus/src/classes/disjoint_set/disjoint_set.h