in this question plz explain the display function wisely, algo to print the output??? plz asap,ty
Create tree ( Using preorder and inorder)
Basically, if you carefully notice by dry run, you will analyze that it is preorder printing of tree, with constraints, or conditions, like for eg,
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;
}
you need to first analyze the tree and its order carefully, only then you will be able to get this printing.