|
C Everything
This is a C repository containing a curated set of generic data structures and algorithm.
|
Contains definitions of routines supported by disjoint_set. More...
#include "disjoint_set.h"Go to the source code of this file.
Functions | |
| void | destroy_disjoint_set (t_gen d) |
Destroy the instance of disjoint set data struct More... | |
| void | disjoint_set_make (t_gen d) |
The MakeSet operation adds a new element More... | |
| int | disjoint_set_find (t_gen d, int x) |
Find the set the node belongs to the method defined follows path halving More... | |
| int | disjoint_set_merge (t_gen d, int x, int y) |
Merge the given two subsets More... | |
| void | disjoint_set_print (t_gen d) |
Print the elem of the disjoint set More... | |
| t_gen | create_disjoint_set (char *name, int size) |
Create an instance of disjoint set data struct More... | |
Contains definitions of routines supported by disjoint_set.
Definition in file disjoint_set.c.
| t_gen create_disjoint_set | ( | char * | name, |
| int | size | ||
| ) |
Create an instance of disjoint set data struct
| name | - Name of disjoint set instance |
| size | - size of the disjoin set |
Definition at line 20 of file disjoint_set.c.
| void destroy_disjoint_set | ( | t_gen | d | ) |
Destroy the instance of disjoint set data struct
| d | - Pointer to instance of disjoint set |
Definition at line 43 of file disjoint_set.c.
| int disjoint_set_find | ( | t_gen | d, |
| int | x | ||
| ) |
Find the set the node belongs to the method defined follows path halving
| d | - Pointer to instance of disjoint set |
| x | - idx of node |
Definition at line 74 of file disjoint_set.c.
| void disjoint_set_make | ( | t_gen | d | ) |
The MakeSet operation adds a new element
| d | - Pointer to instance of disjoint set |
Definition at line 56 of file disjoint_set.c.
| int disjoint_set_merge | ( | t_gen | d, |
| int | x, | ||
| int | y | ||
| ) |
Merge the given two subsets
| d | - Pointer to instance of disjoint set |
| x | - idx of first node |
| y | - idx of second node |
Definition at line 95 of file disjoint_set.c.
| void disjoint_set_print | ( | t_gen | d | ) |
Print the elem of the disjoint set
| d | - Pointer to instance of link list |
Definition at line 123 of file disjoint_set.c.