adding preorder and postorder traversals to tree