UnionFind Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ UnionFind()

UnionFind ( std::size_t  n)

Construct a new union find data structure with n elements.

Parameters
nthe number of elements

After construction each element will be in its own individual set.

Definition at line 5 of file UnionFind.cpp.

Member Function Documentation

◆ find()

std::size_t find ( std::size_t  x)

find the representative of x

Returns
the representative of x

Definition at line 17 of file UnionFind.cpp.

+ Here is the caller graph for this function:

◆ unite()

void unite ( std::size_t  a,
std::size_t  b 
)

unite the sets of the elements a and b

Parameters
a
b

Definition at line 38 of file UnionFind.cpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: