binary tree preorder traversal solution