Apply the DFS procedure for the following undirected graph:
Start the algorithm with the node . If there are several nodes to choose to process next, pick the one with the smallest label.
Print the resulting spanning tree for the graph in the following format:
1 -> 2
2 -> 3
3 -> 4
4 -> 5
Here, each line represents an edge. In your output, the edges should be printed in the order of traversal.