i cant understand the code here, it will search everytime from s to e and what will happen if it doesnt find that element? it will still increase the counter
Build tree from in and pre order
@sktg99
Such a case when it will not find the element in inorder which you are thinking can never happen. We are provided with the preorder and inorder traversals of the same tree. Thus all elements in both the arrays shall be same , only their order different.
okay can u answer my another pending doubt?
@sktg99
That doubt will be acknowledged and replied soon. Have patience.
If your current doubt is resolved , please mark this doubt as Resolved in your doubts section.
can u check that now pls