Calcualtion of mid inside bianry_search()

When calculated mid in binary_search() inside while loop, it found the key in both odd elements and even elements.
But, when calculated mid outside while loop in binary_search() it only gave result in odd no.of elements in the array.

@yogeshcsc20 please share the code and the question.
Also, you need to calculate mid repeatedly for changing values of start and end, I dont understand how/why are you calculatinf it outside of the while loop?

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.