do we need to have a sorted array for using upper_bound() and lower_bound() functions present in algorithm header file?
Some doubts in stl
Yes the array needs to be sorted to get the correct result.
yes array should be sorted
otherwise it will give wrong ans
but why you reopen this doubt after 8 months??
do you have any further doubt in it
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.