See this function . This is showing segmentation fault. postorder and inorder.
How to construct tree with postorder and inorder?
base condition should be if(s>e)
I am passing total length , that’s why base condition if(s>=e)
what is inLength in your 2nd function, also send complete code.
@raj.verma5454 as you are doing it for Postorder traversal which is like Left,Right, Root and you are traversing from last, so your recursive call for right child should be before that for left child.
Just correct the condition -> s>=e because here ‘e’ variable you used is not actually pointing to a index, it is just pointing to the totalLength.
@raj.verma5454 Also mark this doubt as resolved if you are able to solve it now.
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.