upper_bound、lowe_bound、binary_search
upper_bound、lowe_bound
1. 返回的是地址
2. 如果找不到,返回 右边界下标+1 或者 0
- 升序
int *a = lower_bound( first,last, key ): 第一个 >= key 的地址
int b = upper_bound( first,last, key ):第一个* > key** 的地址 - 降序
第四个参数 greater< Type >()
lower_bound( first,last, key, greater< Type >()): 第一个 <= key 的地址
upper_bound( first,last, key, greater< Type >()):第一个* < key* 的地址
binary_search
二分查找,返回bool,三个参数,起始地址,数组长度,查找值。