Problem in lower bound and upper bound

Does lower bound and upper bound functions in the algorithm header file give the correct results only for sorted array or also for the unsorted array. I Have made an attempt but to solve the above and it is not working for unsorted arrays pls confirm.

It works only for sorted array.

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.