Pairing DSU Problems- Graph

Here is the link of code.
Why it showing segmentation fault???
Please help.