python binary tree preorder traversal