Add non-recursive DFS tree traversal.