STL

栈 stack

stack<int> p; //创建一个名为p的栈
p.push(x);
p.pop();
p.size();
p.top();

队列 queue

queue<int> q;
q.push(x);
q.pop();
q.size();
q.front();
q.back();

优先级队列 priority_queue

priority_queue<int> p;
p.push(x);
p.pop();
p.size();
p.top();

2019/3/2 STL初步

相关文章: