C++ 容器适配器-队列

来源:互联网 发布:宁波ug编程培训 编辑:程序博客网 时间:2024/05/27 12:22

1、queue队列:FIFO 先进先出

2、自适应容器(容器适配器)

3、队列适配器

queue<int,deque<int>> q;

queue<int,list<int>> q;

//queue<int, vector<int>> q; 不能用vector,因为vector不能先进先出

q.empty();

q.size();

q.front();//查看头

q.back();//查看尾

q.pop();//弹出头

q.push(item);//插入尾

0 0
原创粉丝点击