C++ dequeue双端队列用法
deque<int> deq;
for (int i = 0; i < 20; ++i)
{
deq.push_back(i);
}
for (int j = 0; j < 20; ++j)
{
int tem = deq.back();
cout << tem << " " ;
deq.pop_back();
//cout << deq[j] << " ";
}
cout << endl;
cout << "双端队列中元素总数:" << deq.size() << endl;