一些基本操作
#include<deque>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
deque <int> a;
//末尾插入
a.push_back(4);
a.push_back(5);
a.push_back(6);
//数组下标法
for(int i = 0; i < a.size(); i ++)
cout << a[i] << ' ';
cout << endl;
//从头部插入
a.push_front(3);
a.push_front(2);
a.push_front(1);
for(int i = 0; i < a.size(); i ++)
cout << a[i] << ' ';
cout << endl;
//删除尾部 删除头部
a.pop_back();
a.pop_front();
//使用 迭代器
for(auto p = a.begin(); p != a.end(); p ++)
cout << *p << ' ';
cout << endl;
}