My code isn't working

I used Kruskal algorithm but with edges in descending order. Then i used the edges which weren’t used in the kruskal algo to find the edges to delete. However, I’m getting a segmentation fault.

code-https://ide.codingblocks.com/s/344417