You specified a completely correct bypass of the DFS graph, and the tutorial gives you another completely finished bypass of the DFS graph. There can be many transitions in depth of the same graph (in fact, there are often exponentially many), so if you do not get the same as your textbook, that is not the immediate cause of the alarm.
Here are some other orderings:
1 2 5 4 3 6 3 1 6 2 5 4 5 4 2 3 1 6 ...
However, if there are some other rules about how to visit nodes (for example, always visiting linked nodes in ascending or descending order), then a DFS search will always return the same result.
Hope this helps!
source share