|
A simple union find data structure. More...
#include <armarx/navigation/components/laser_scanner_feature_extraction/UnionFind.h>
Public Member Functions | |
std::size_t | find (std::size_t x) |
find the representative of x More... | |
UnionFind (std::size_t n) | |
Construct a new union find data structure with n elements. More... | |
void | unite (std::size_t a, std::size_t b) |
unite the sets of the elements a and b More... | |
A simple union find data structure.
The data structure supports a fixed size of n elements which must be the integers from [0, n).
Definition at line 39 of file UnionFind.h.
UnionFind | ( | std::size_t | n | ) |
Construct a new union find data structure with n elements.
n | the number of elements |
After construction each element will be in its own individual set.
Definition at line 5 of file UnionFind.cpp.
std::size_t find | ( | std::size_t | x | ) |
find the representative of x
Definition at line 17 of file UnionFind.cpp.
void unite | ( | std::size_t | a, |
std::size_t | b | ||
) |
unite the sets of the elements a and b
a | |
b |
Definition at line 38 of file UnionFind.cpp.