data_structures
|
Go to the source code of this file.
Data Structures | |
struct | s_union_find |
Weighted quick-union by rank with path compression by halving. More... | |
Typedefs | |
typedef struct s_union_find | t_union_find |
Functions | |
t_union_find * | union_find_new (size_t size) |
Initializes a new union-find data structure of the specified size. More... | |
void | union_find_union (t_union_find *uf, size_t p, size_t q) |
Merges the set containing element p with the set containing element q . More... | |
size_t | union_find_count (const t_union_find *uf) |
Returns the number of disconnected sets. More... | |
size_t | union_find_size (const t_union_find *uf) |
Returns the number of elements in this union-find. More... | |
void | union_find_delete (t_union_find *uf) |
Deletes the union-find and frees all memory taken by its contents, or does nothing if the argument is NULL . More... | |
size_t | union_find_find (const t_union_find *uf, size_t p) |
Returns the canonical element of the set containing the specified element. More... | |
size_t union_find_count | ( | const t_union_find * | uf | ) |
Returns the number of disconnected sets.
Definition at line 16 of file union_find_count.c.
void union_find_delete | ( | t_union_find * | uf | ) |
Deletes the union-find and frees all memory taken by its contents, or does nothing if the argument is NULL
.
Definition at line 16 of file union_find_delete.c.
size_t union_find_find | ( | const t_union_find * | uf, |
size_t | p | ||
) |
Returns the canonical element of the set containing the specified element.
p | An element |
Definition at line 16 of file union_find_find.c.
t_union_find* union_find_new | ( | size_t | size | ) |
Initializes a new union-find data structure of the specified size.
Definition at line 16 of file union_find_new.c.
size_t union_find_size | ( | const t_union_find * | uf | ) |
Returns the number of elements in this union-find.
Definition at line 16 of file union_find_size.c.
void union_find_union | ( | t_union_find * | uf, |
size_t | p, | ||
size_t | q | ||
) |
Merges the set containing element p
with the set containing element q
.
p | on element |
q | the other element |
Definition at line 16 of file union_find_union.c.