C++ 标准模板类

1.标准模板库

1.1 vector 向量

本质:vector是对数组的封装。
初始化方法:




迭代器:iterator

使用方法:相当于指针
list只能使用iterator进行遍历,过程与vector一样。
map的遍历略有不同,需要单独输出每一对数据的第一个和第二个,如图所示:






1.2 list 链表模板

特点:数据插入速度快(和vector相比)

1.3 map映射

数据结构:key和value成对出现








1 STL 简介 ..............................................................................................................................................2 2 顺序性容器...........................................................................................................................................2 2.1 C++ VECTOR(向量容器) ...........................................................................................................2 2.2 C++ LIST(双向链表) .................................................................................................................4 2.3 C++ DEQUE(双向队列) ..................................................................................................................6 2.4 三者比较........................................................................................................................................8 3 关联容器...............................................................................................................................................8 3.1 特点................................................................................................................................................8 3.2 C++ SETS & MULTISETS .................................................................................................................9 3.3 C++ MAPS & MULTIMAPS ............................................................................................................ 11 4 容器适配器.........................................................................................................................................12 4.1 特点..............................................................................................................................................12 4.2 C++ STACKS(堆栈) ..................................................................................................................13 4.3 C++ QUEUES(队列) ......................................................................................................................13 4.4 C++ PRIORITY QUEUES(优先队列)...............................................................................................13 5 迭代器.................................................................................................................................................14 5.1 解释..............................................................................................................................................14 5.2 功能特点......................................................................................................................................14 6 C++标准库总结..................................................................................................................................15 6.1 容器..............................................................................................................................................15 6.2 算法..............................................................................................................................................15 6.3 函数对象......................................................................................................................................17 6.4 迭代器..........................................................................................................................................19 6.5 分配器..........................................................................................................................................19 6.6 数值..............................................................................................................................................19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值