UF *UFNew(int max_sets)
Creates the structure to use the unionfind algorithm
The disjoint set structure
int UFFind(UF *set,int a)
Finds the top-most parent of the element a.
The top-most parent of a
UF *UFJoin(UF *set,int a,int b)
Frees the memory used by set