![]() |
naev 0.12.5
|
Implements ye olde disjoint-set-forest data structure. More...

Go to the source code of this file.
Functions | |
| void | unionfind_init (UnionFind *uf, int n) |
| Creates a UnionFind structure on {0, ..., n}. | |
| void | unionfind_free (UnionFind *uf) |
| Frees resources associated with uf. | |
| void | unionfind_union (UnionFind *uf, int x, int y) |
| Declares x and y to be in the same subset. | |
| int | unionfind_find (UnionFind *uf, int x) |
| Finds the designated representative of the subset containing x. | |
| int * | unionfind_findall (UnionFind *uf) |
| Returns a designated representative of each subset in an array (array.h). | |
Implements ye olde disjoint-set-forest data structure.
Definition in file union_find.c.
| int unionfind_find | ( | UnionFind * | uf, |
| int | x ) |
Finds the designated representative of the subset containing x.
Definition at line 48 of file union_find.c.
| int * unionfind_findall | ( | UnionFind * | uf | ) |
Returns a designated representative of each subset in an array (array.h).
Definition at line 57 of file union_find.c.
| void unionfind_free | ( | UnionFind * | uf | ) |
Frees resources associated with uf.
Definition at line 25 of file union_find.c.
| void unionfind_init | ( | UnionFind * | uf, |
| int | n ) |
Creates a UnionFind structure on {0, ..., n}.
Definition at line 14 of file union_find.c.
| void unionfind_union | ( | UnionFind * | uf, |
| int | x, | ||
| int | y ) |
Declares x and y to be in the same subset.
Definition at line 34 of file union_find.c.