why the first solution runtime faster than the second solution runtime?

#first solution:
if(root==NULL) return NULL;
if(root->val == val)
return root;
if(val>root-> val)
return searchBST(root->right,val);
else
return searchBST(root->left,val);

#second solution:

if(root==NULL)
return NULL;
if(root->val==val)
return root;
TreeNode* temp=searchBST(root->left,val);
if(temp!=NULL && temp->val==val)
return temp;

 TreeNode* temp1=searchBST(root->right,val);
 if(temp1!=NULL && temp1->val==val)
    return temp1;
    
    return NULL;
Comments (1)