Python, Graph, Algorithms.
backtrack to B, which has another unvisited adjacent vertex, E. We visit E and push it to the stack. Now, E has no unvisited adjacent vertices, so we backtrack by popping E from the stack. We backtrack to B, then to A. Finally, we visit A’s other adjacent vertex, C, and push it to the stack. Now,