Consider the following graph:
Among the following sequences:
which are depth first traversals of the above graph?
For GATE purpose, without actually Applying DFS, you could answer by just seeing options.
In DFS, we go in depth first i.e., one node to another in depth first order.
Here, abfehg is not possible as we can not go from f to e directly.
Thus, option D is correct.
In all the other options we could reach directly from the node to the next node.
So, just visualize and do.
Answer will be (D)
DFS goes upto how much depth possible and then backtrack and go to the next link.
Here only 'abfehg' not possible because e and h consecutively is not possible by any backtracking of DFS traversal