Introduction - If you have any usage issues, please Google them yourself
finds the smallest leaf node at a time, and outputs its adjacent node (the leaf node has only one adjacent node) to delete the leaf node. The loop does this to the graph until there is only one node left. In the end, the total number of N-1 is output.