Could you tell me the condition in which my code for binary search fails?
When I am submitting it on the HackerBlocks platform 2/4 cases are failed.
Doubt in Binary Search
Hi… in the else condition dont write mid+1…
simply write mid.
cout << mid << endl;
it will pass all test cases…
Thanks! Its working now.
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.