Doubt regarding code

can you tell me where am i wrong in this code as i am not getting the required answer
this is the code for binary_search using recursion.

Have debugged your code here, check now it’s giving correct output

can you please tell me what changes have you done

There were three changes I did, in your else if and else conditions you are calling function, just have added return in front of that function call. And in the end you will see that it’s a bool function . So we have to return either true or false. So we will return false in the end that we haven’t find that element.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.