optimze build tree from inorder and preorder