build tree via preorder/inorder/postorder