what is display function here?
How we have to display the output?
How to display output in question of building tree from preorder and inorder?
@coder_ag hey abhishek this very easy question all you need to design a print function
you have to consider 4 cases
2 => 1 <= END
3 => 2 <= END
END => 3 <= END
case 1 if root->left!=null &&root>right!=null
2 => 1 <= 4
then you have to print values on the both sides and in mid there will be root->data
case 2 if root->left==null and root->right==null
END => 3 <= END
if root->left!=null and root->right==null
2 => 1 <= END
if root->left==null and root->right!=null
END => 3 <= 7
Note in mid parent root node will be there
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.