Create tree (using preorder and inorder)

Actually I am not able to understand the display function means how it is printing the tree. Can you tell me the logic?

hi ashutosh
it is something like when right child is not NULL and leftchild also is not NULL
then cout<left->data<<" => “<data<<” <= “<right->data<<endl;
like this when right is NULL and left is not NULL
then cout cout<left->data<<” => “<< root->data <<” <= END"<<endl;
like this form all the cases and display the output accordingly