The idea
Depth-first search takes the first path off Q and pushes its extensions onto the front, like a stack. Without a visited list the same state can sit in Q many times; only loops back onto the current path are blocked.
Undirected graph. Link costs: S–A 2, S–B 5, S–C 4, A–D 3, B–D 1, B–E 4, C–E 3, D–F 2, E–F 1, E–G 5, F–G 3. Heuristic h: S 9, A 7, B 5, C 6, D 4, E 4, F 3, G 0 (admissible and consistent).
Search from S to G. Children are generated in alphabetical order, a path is never extended back to a state already on it, and the goal test happens when a path is removed from Q. Apply Depth-First Search without a Visited List. What is the sequence of states expanded?