#include <disjointsets.h>
template<typename T = int>
class inviwo::DisjointSets< T >
Disjoint sets data structure with path compression and weighted unions.
- See also
- https://en.m.wikipedia.org/wiki/Disjoint-set_data_structure
◆ DisjointSets()
Construct size disjoint sets with 1 member in each set.
◆ cardinality()
Returns cardinality of the set for element x Requires x to be positive and less than size.
◆ find()
Returns name of the set for element x i.e. return root of tree for element x Requires x to be positive and less than size.
◆ join()
Join the sets of element r and s. Requires r and s to be positive and less than size. Return true it the sets were joined or false if r and s already were in the same set.
◆ size()
Returns the total number of elements in all sets
The documentation for this class was generated from the following file: