vector的一些操作
2015-07-29 14:52
330 查看
做题的时候,碰到vector的一些函数,特此记下来。1.reserve(n): Requests that the vector capacity be at least enough to contain n elements2.lower_bound
1)lower_bound (ForwardIterator first, ForwardIterator last, const T& val);
2)lower_bound (ForwardIterator first, ForwardIterator last, const T& val, Compare comp);Returns an iterator pointing to the first element in the range [first,last) which does not compare less than val.3.upper_bound
1)upper_bound (ForwardIterator first, ForwardIterator last, const T& val);2)upper_bound (ForwardIterator first, ForwardIterator last,
const T& val, Compare comp);
Returns an iterator pointing to the first element in the range [first,last) which compares greater than val.
4.insertvoid insert (iterator position, InputIterator first, InputIterator last);
从position开始,插入[first, last)的元素
相关文章推荐
- Highcharts前端报表
- 设计模式(3):抽象工厂模式
- java keytool 使用
- DH密钥交换(Diffie–Hellman key exchange)算法笔记
- POJ 2823 Sliding Window
- php 正则表达式捕获组与非捕获组
- 简单的一个哈希查找函数
- 多线程学习总结
- poj 2342 Anniversary party(树形dp)
- Win10正式发布 190个国家和地区免费升级或购买预装电脑获取
- OC特有语法—@property
- HDOJ 5318 The Goddess Of The Moon 矩阵快速幂
- leveldb 性能、使用场景评估
- 快速排序的两种实现
- html加载顺序、onload、JQ.ready()
- Maven项目模板
- LeetCode(78) Subsets
- css弹出遮罩层
- 快速清除Andorid项目中无用资源
- 浅拷贝和深拷贝