can we only use lower_bound and upper_bound on a sorted array, or we can use to find frequencies of elements in an unsorted area too.
Algorithm library
lower_bound and upper_bound function will work only for sorted arrays.
For unsorted arrays, you can use the find function which is actually a linear search
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.