Building tree from pre and inorder


pleade tell my mistake ,it is showing error.

Varun, you need to use the following function for printing the tree as :
void printTree(node* root)
{
if(root==NULL)
{
return;
}

if(root->left!=NULL && root->right!=NULL)
{
cout<left->data<<" => "<data<< " <= "<right->data<<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<<" <= END"<<endl;
}

if(root->left == NULL && root->right == NULL)
{
cout << “END => " <data << " <= END” << endl;
}
printTree(root->left);
printTree(root->right);
}

that is right but i was checking that whether the tree has been made right or not ,so i used normal pre order print

but it is showing error like core dumped ,

Ok… pls wait… I will see to the error in the build function…