Plz check my code for Create tree Using preOrder and inOrder

Hi Shantanu,
First base case wiile be if(preS>preE){return null}. Also since while checking the index at which the root node exist in inorder arrray you have updated the value of rootnode to index and then created the node with data as rootnode you had actually created the node with data as index instead of value at that index.