Help needed in debugging the code. Binary Tree From Inorder and Preorder

My code is showing wrong output. Could you help me out in finding the error? Moreover i am not able to find the way to print the binary tree as stated in question. So, could you help me out in coding out the modified preorder as stated in question?

For printing the tree… If you carefully observe… then it can be done using following code snippet as :

if(root==NULL)
{
return;
}
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;
}

print(root->left);
print(root->right);

I have also edited your code a little bit… Try to submit it now…