Code giving runtime error

I have edited your code, it is producing output now, but the output is different from wht is expected, so for that plz change your print function, include these conditions in your code,

if(root->left!=NULL && root->right==NULL)
{
cout<left->data<<" => β€œ<data<<” <= β€œ<<β€œEND”<<endl;
}
if(root->left ==NULL && root->right==NULL)
{
cout<<β€œEND”<<” => β€œ<data<<” <= β€œ<<β€œEND”<<endl;
}
if(root->left==NULL && root->right!=NULL)
{
cout<<β€œEND”<<” => β€œ<<” β€œ<data<<” <= β€œ<right->data<<endl;
}
if(root->left!=NULL && root->right!=NULL)
{
cout<left->data<<” => β€œ<<” β€œ<data<<” <= "<right->data<<endl;
}

@yuktimutreja01 its still showing wrong output. theres a problem with the buildpreino function


I have edited your code, kindly refer to it.