the given code is showing compilation error
Compilation error
your build tree function is not according to given input
make a new build tree fucntion
this is correct build Tree function
node*buildtree()
{
int d;cin>>d;
node*n=new node(d);
string s;
cin>>s;
if(s=="true") n->left=buildtree();
else n->left=NULL;
cin>>s;
if(s=="true")n->right=buildtree();
else n->right=NULL;
return n;
}
i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course