lower_bound( )和upper_bound( )都是利用二分查找的方法在一个排好序的数组中进行查找的。
1.从小到大
lower_bound(start,last,n) :返回第一个大于等于n的地址
upper_bound(start,last,n) :返回第一个大于n的地址
2.从大到小
lower_bound(start,last,n,greater()) :返回第一个小于等于n的地址
upper_bound(start,last,n,greater()) :返回第一个小于n的地址