trees: pre-order traversal non-recursive