how the return statement effect why we can’t do like without return .
Binary Search recursively
@Vikaspal if you dont use the “return” keyword, how will the answer be returned? The function returns some value, but if you dont return that value, it will not be propogated further and you will end up returning -1 always, and not the correct answer. The correct answer is given by the binary search function and so you need to return that value.
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.