I’ve used this code but i’m unable to get the desired output from this code for the binary search problem
Wrong ouput showing
@Divit-Goel-2940158062683318
line 18 and line 22 should be return binary(arr,key,s,mid-1); and return binary(arr,key,mid+1,e);
respectively
still not getting the output, can you give me the modified code?
@Divit-Goel-2940158062683318
This code will return index of key if it exists. If key doesn’t exist, it would return “-1”
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.