![](https://img-blog.csdnimg.cn/bf7291090f514695a968980a180eb0f3.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
C++ STL
列举一些C++ STL的使用方法
再敲一行就去睡
这个作者很懒,什么都没留下…
展开
-
STL容器:list
list是一个双向链表 list包含在以下头文件中: #include <list> 声明: list<Elemtype> name list操作集 push_front,push_back l.push_front(x),l.push_back 将x插入到首/尾 pop_front,pop_back l.pop_front(),l.pop_back() 删除首/尾元素 remove l.remove(x) 删除所有值为x的原创 2022-03-25 00:21:54 · 1630 阅读 · 0 评论 -
STL容器:vector
vector的特点:内存动态增长、紧凑存储、遍历效率高、支持简单高效的随机访问。 vector包含在以下头文件中: #include <vector> 声明: vector<Elemtype> name 通过下标访问: v[i] 通过迭代器访问: vector<Elemtype>::iterator i vector操作集 push_back() v.push_back(x) 将x插入到末尾 pop_back() v.po原创 2022-03-24 23:45:02 · 125 阅读 · 0 评论 -
STL容器
顺序容器 vector<Elemtype> #include <vector> 顺序表 list<Elemtype> #include <list> 双向链表 forward_list<Elemtype> #include <list> 单链表 deque<Elemtype> #include <deque> 双端队列 有序关联容器 map<原创 2022-03-24 23:14:01 · 776 阅读 · 0 评论