Construct Tree from Inorder and Preorder. Help needed in debugging

My code is showing wrong output could you please tell me where i am going wrong in building the tree?

I have edited your code… Try to submit it now…