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;

posted @ 2013-07-06 12:42  Predator  阅读(1909)  评论(0编辑  收藏  举报