Problem in dry run

I understood the case when 1 is taken but when 2 is taken then then root -> left is called on s = 0 and e = index - 1
and root -> right is called on s = index + 1 e = e
as inorder array is 3 2 8 4 1 6 7 5
then for root -> left recursive call will be done at the part from 3 to 3 {3} as s = 0 index - 1 = 0
but for rroot -> right recursive call is done on the part from 8 to 5 {8, 4, 1, 6, 7, 5} as s = 2 and e = 7 but in the video the recursive call is made only on the part from 8 to 4(8,4) how ??

No here call is sone on 8 to 4 because in previous call of root->left s=0 and e=(index of 1)-1=3
Now here fro s->right it became (index of 2)+1 to e which is 2 to 3

If this resolves your query then please mark it as resolved :slight_smile:

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.