In this implementation of union find, I think in the Union function
int xroot = find(subsets, x);
int yroot = find(subsets, y);
function calls are unnecessary because we already find the parents of the edges in the iscycle function
int x = find(subsets, graph->edge[e].src);
int y = find(subsets, graph->edge[e].dest);
And pass the found parents to the union function
Union(subsets, x, y);
So again finding parents inside the union function is unnecessary. Can anyone confirm if this is valid and if not why