Golden Rule
DFS me agar tum kisi vertex par ho, to jab tak us vertex ke subtree me unvisited vertex available hain, DFS backtrack nahi karega.
Option 1: a b e f d g c
Track karo:
a → b → e → f
Ab f ke unvisited neighbours = {c, g}
Lekin sequence bol raha hai next = d.
DFS directly d par jump nahi kar sakta.
Hence, incorrect.
Option 2: a b e f c g d
a → b → e → f → c
c ke saare neighbours already visited hain (b,e,f).
Backtrack to f.
Then g.
Then d.
Sab legal hai. Possible
Option 3: a d g e b c f
a → d → g → e → b → c
At c, neighbour f unvisited hai.
So next f aa sakta hai.
Possible.
Option 4: a d b c g e f
a → d → b → c
At c, unvisited neighbours = {e,f}.
DFS must go to one of them.
But sequence says next = g.
Hence, incorrect.