Correct me if I am wrong, but the naive non-recursive DFS and BFS differ only in the implementation of queue.
https://gist.github.com/1791284
EDIT: In retrospect, you did mention you find it interesting - don't know how it jumped out as incredulous.
Correct me if I am wrong, but the naive non-recursive DFS and BFS differ only in the implementation of queue.
https://gist.github.com/1791284