preorder traversal iteratively