PREORDER INORDER

https://ide.codingblocks.com/s/433068,
PLEASE CHECK THIS CODE, WHAT IS ERROR IN THE FUNCTION?

you have to add this condition
if(s==e){
i++;
return root;
}