pre-order tree traversal-- both recursion and iterative wal