deque时间复杂度和vector,list比较
2015-06-24 21:20
686 查看
deque supports const time insert and erase operations at the beginning or the end, insert or erase in the middle take linear time.
vector在中间位置插入和删除操作时间复杂度为O(N);vector的push_back, pop_back操作时间复杂度为O(1), 头部插入和删除操作时间复杂度为O(N);deque的push_back, push_front, pop_back, pop_front操作时间复杂度为O(1);
vector在中间位置插入和删除操作时间复杂度为O(N);vector的push_back, pop_back操作时间复杂度为O(1), 头部插入和删除操作时间复杂度为O(N);deque的push_back, push_front, pop_back, pop_front操作时间复杂度为O(1);
相关文章推荐
- IOS UILabel的常用属性
- Android属性之build.prop生成过程
- [leetcode] Unique Paths
- iOS学习笔记(3)UIButton
- UITextField隐藏键盘的几种方式
- Sicily 1443. Printer Queue
- 解决 Errors running builder 'DeploymentBuilder' on project ' .
- View requires API level 14 (current min is 8): <Switch>
- CSU 1658 IQ of XUEXX’s descendants 矩阵快速幂
- C# WebRequest WebClient Post请求Demo
- ZJU2136 Longest Ordered Subsequence
- iOS下载文件之NSData -UIImage
- UILabel和UITableview自定义分割线
- Bluemix云平台实践: CLI应用之DB2控制台(2)
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Query was empty
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Query was empty
- An internal error occurred during: "Building workspace". GC overhead limit exceeded
- An internal error occurred during: "Building workspace". GC overhead limit exceeded
- Bluemix云平台实践: CLI应用之DB2控制台(1)
- 限制 UITextField 输入长度