Brief overview:-
The functions upper_bound() and lower_bound() functions are useful when we have data stored in a non-decreasingly sorted format and in a given range in the data structure we want to find out:
- position of the smallest number just > (greater) a given number
- position of the smallest number >= (greater than or equal to) a given number
we can use these 2 functions.
upper_bound() :-
- returns an iterator pointing to the element just greater than the given number
lower_bound() :-
- returns an iterator pointing to the element greater than or equal to the given number