sir I do not understand the base case which is:
if(s>e)
return nullptr;
Build tree from post order and pre order
It’s same as what you have done in mergesort function when your start index becomes greater then end index you just assign a null pointer as a child to current node. Try to do dry run once. You will get the intuition for sure.
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.