in this upper and lower bound question,
i am clear with the concept of binary search and all the concept
but it gives me wrong output
please provide me the program with explanation of it in the program itself. It will be beneficial to understand that where my output is coming wrong
Output doubt is coming
can u pls send me ur code
binary search is only applicable for the sorted array
the concept of binary search:
as u know the array is sorted
so taking the mid point of the array
if mid is not ur ans
then either ur ans will lie in the left region if ur target is less than the mid value
or similarly either on right side
hope this will help u
pls rate my work
pls
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.