This formulation of DFS (which tracks a stack of nodes to visit) is less efficient than one that tracks a stack of iterators, because the size of your stack is O(vertices) instead of O(graph depth). On the other hand, it's simpler in some ways, so I can see why it would be preferable in some situations.
Queue = BFS
Stack = DFS
Priority queue by distance from start = Dijkstra's algorithm
Priority queue by distance + heuristic = A*
Bounded priority queue by heuristic = Beam search
Priority queue by connecting edge weights = Prim's algorithm
Pointer reversal = Mark & sweep garbage collector
Check on whether it points into from-space = Copying garbage collector.
http://aima-python.googlecode.com/svn/trunk/search.py
It's a long file though.
Correct me if I am wrong, but the naive non-recursive DFS and BFS differ only in the implementation of queue.
In the gist, queue.push adds element to the tail end, and queue.pop removes from the tail end.
For it to be behave as BFS, you will have to change queue.pop to queue.shift which will remove elements from the front.
An ideal graph search implementation will take queue as a parameter, and will use queue.enqueue and queue.dequeue. And then the injection -> implementation mapping will be:
But I didn't want to go through all that trouble to demonstrate a simple snippet.