![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
STL
猪八戒1.0
欢迎大家私信和我交流
展开
-
queue
queue<Type> q; q.push(item); //入队列 q.front(); //返回队首元素 q.back(); //返回队尾元素 q.pop(); //删除队首元素 q.size(); //个数 q.empty(); ...原创 2022-04-05 19:53:57 · 68 阅读 · 0 评论 -
stack
#include<bits/stdc++.h> using namespace std; int main() { stack<int> s; stack<int> s1; for(int i=1;i<=15;i++){ s.push(i); } cout<<"栈中元素个数:"<<s.size()<<endl; cout<<"栈顶元素是:"<<s.top()<<endl; s.原创 2022-04-05 19:40:04 · 324 阅读 · 0 评论 -
vector
#include<bits/stdc++.h> using namespace std; int main() { vector <int> a; for(int i=1;i<=15;i++){ a.push_back(i); } cout<<a.empty()<<endl; //空为1,非空为0 a.insert(a.begin()+3,10); //第三个元素后插入10 a.pop_back(); //.原创 2022-04-05 19:05:15 · 170 阅读 · 0 评论