60 for(
int i = 0; i < set->
size; i++) {
99 x = set->
find(set, x);
100 y = set->
find(set, y);
128 for(
int i = 0; i < set->
size; i++) {
void destroy_disjoint_set(t_gen d)
Destroy the instance of disjoint set data struct
void disjoint_set_print(t_gen d)
Print the elem of the disjoint set
t_gen create_disjoint_set(char *name, int size)
Create an instance of disjoint set data struct
int disjoint_set_merge(t_gen d, int x, int y)
Merge the given two subsets
void disjoint_set_make(t_gen d)
The MakeSet operation adds a new element
int disjoint_set_find(t_gen d, int x)
Find the set the node belongs to the method defined follows path halving
Contains declations of disjoint_set types, operations and structure.
#define free_mem(mem_addr)
#define get_mem(nmemb, size)
Disjoint set main struct definition.
f_print print
routine to print elements in the disjoint set
int size
Max size of elems stored in disjoint set.
f_set2 merge
routine to merge to set
char * name
Name of link list instance */.
f_destroy destroy
routine to destroy the instace of disjoint set
t_dsetnode * subset
Pointer to N sets.
f_set1 find
routine to find an elem in the set
f_vgen make
routine to add an new elem to the set
Disjoint set node definition.
int size
size of the current set
int parent
Parent idx of the set.
void * t_gen
Base Data type used for all data structure and data elements.