deque时间复杂度和vector,list比较

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);

    原文作者:kkshaq
    原文地址: https://www.cnblogs.com/kkshaq/p/4598683.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞