Recursion function to perform binary search


compilation error aa rha h code kaha galat h ??

this is warning that while compliling the code function executation ma reac at end of functon where there is nothing to return
this should not happen for non-void functions

just return 0 at end of function

last wali if condition hata ke return 0 h bas
key found hone pr 0 output aa rha aur not found hone per TLE

your approach is not correct

see this i have done some modification
if found it return index otherwise -1

Modified Code

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.