I would find it very difficult to implement a DFS that does not have
some notion of the previously visited edges. Even a recursive
implementation has a stack. Beware though, you may overflow the stack
on larger graph components if done naively.
-Robert
I think if you do this you can't claim that you are doing a depth
first search. In DFS you first have to go as deep as possible.
-Nikos
The best solutions are to manually manage the stack, or use BFS.
-Robert