Here array was 20,30,40,40,40,50,100…
why was lower bound same as upper bound for 40 here
?
Confusion in upper bound and lower bound
Hello @Sayon-Palit-2873308702757758,
No, it is not same.
Lower Bound: returns an iterator pointing to the first element in the range [first,last) which does not compare less than val.
Upper Bound: Returns an iterator pointing to the first element in the range [first,last) which compares greater than val.
You may refer to the follwoing code:
Hope, this would help.
Give a like if you are satisfied.
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.