set_element* make_set(int key)
{
set_element* node = (set_element*) malloc(sizeof(set_element));
node->parent = node;
node->rank = 0;
}
In the above code there was no return statement and the function was used like this
elem1 = make_set(f1);
And the code was working as expected. This is very funny. I am not how the hell this was working.