首页 > 编程语言 > 详细

Difference Between Vector and Deque in C++

时间:2014-11-28 14:14:17      阅读:277      评论:0      收藏:0      [点我收藏+]

1) Dequeue can quickly insert or delete both at the front or the end. However, vector can only quickly insert or delete at the end.

2) Memory allocation is different. A vector always occupies a contigious region of memory. If a vector goes too large, it need to be moved to a new location where it can fit. A deque,on the other hand, can be stored in several non-contigious areas; it‘s segmented. So a deque doesn‘t need to be moved if it goes too large.

 

Difference Between Vector and Deque in C++

原文:http://www.cnblogs.com/Kai-Xing/p/4128341.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!