Why did we do mid-1 and mid+1 ?
Will it be correct to use mid in both?
BINARY SEARCH BOUNDATION
hello @pkdeka1074
…
u loop mau get stuck in infinite loop.
for example if s==e
then mid will also be s.
and if u update s or e with mid again then their value will remain as it is.
and loop will never stop
Is it not handled by the base case itself?
…
no , aas per bhaiya’s implementation there is no need to handel this case.
but the way u want to implement in that u need to made some modifications
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.