Disjoint Set data structure. Helps to test the acyclicity of the graph during construction. More...
#include <disjointset.h>
Public Member Functions | |
uint32_t | getfa (int i) |
void | finish () |
Release the memory to save some space. | |
void | setLength (int n) |
void | clear () |
re-initilize the disjoint sets. | |
void | merge (int a, int b) |
bool | sameset (int a, int b) |
bool | isroot (int a) |
bool | resize (int n) |
add new keys, so that the total number of elements equal to n. | |
Disjoint Set data structure. Helps to test the acyclicity of the graph during construction.