Can you please explain me the search function code here. When we are looking for the node in the left side of the tree why we are checking if left !=-1. I know to check if left is present but why we are not checking for right also before checking that condition.
I mean to say
why not int left=…
int right=…
then our if(left!=-1 or right!=-1)
{ return that particular node}
