当前位置:网站首页>C + + STL container
C + + STL container
2020-11-10 08:45:00 【D3qbz0a】
| Containers | Underlying data structure | Time complexity | There is disorder | It can't be repeated | other |
|---|---|---|---|---|---|
| array | Array | Read at random O(1) | disorder | repeatable | Support random access |
| vector | Array | Read at random 、 Tail insertion 、 Tail delete O(1), Head insertion 、 Head delete O(n) | disorder | repeatable | Support random access |
| deque | deque | Insert head and tail 、 Delete the beginning and the end O(1) | disorder | repeatable | A central controller + Multiple buffers , Support the rapid addition and deletion of , Support random access |
| forward_list | One way linked list Insert 、 Delete O(1) | disorder | repeatable | Random access is not supported | |
| list | Double linked list | Insert 、 Delete O(1) | disorder | repeatable | Random access is not supported |
| stack | deque / list | Insert at the top 、 Delete at the top O(1) | disorder | repeatable | deque or list Close the head end opening , no need vector The reason should be that the capacity is limited , Expansion takes time |
| queue | deque / list | Tail insertion 、 Head delete O(1) | disorder | repeatable | deque or list Close the head end opening , no need vector The reason should be that the capacity is limited , Expansion takes time |
| priority_queue | vector + max-heap | Insert 、 Delete O(log2n) | Orderly | repeatable | vector Containers +heap Handling rules |
| set | Red and black trees | Insert 、 Delete 、 lookup O(log2n) | Orderly | Do not repeat | |
| multiset | Red and black trees | Insert 、 Delete 、 lookup O(log2n) | Orderly | repeatable | |
| map | Red and black trees | Insert 、 Delete 、 lookup O(log2n) | Orderly | Do not repeat | |
| multimap | Red and black trees | Insert 、 Delete 、 lookup O(log2n) | Orderly | repeatable | |
| unordered_set | Hashtable | Insert 、 Delete 、 lookup O(1) The worst O(n) | disorder | Do not repeat | |
| unordered_multiset | Hashtable | Insert 、 Delete 、 lookup O(1) The worst O(n) | disorder | repeatable | |
| unordered_map | Hashtable | Insert 、 Delete 、 lookup O(1) The worst O(n) | disorder | Do not repeat | |
| unordered_multimap | Hashtable | Insert 、 Delete 、 lookup O(1) The worst O(n) | disorder | repeatable |
版权声明
本文为[D3qbz0a]所创,转载请带上原文链接,感谢
边栏推荐
- ServiceManagerProxy中mRemote变量指的什么?
- 【技术教程】Visual Studio 2017自建WebRTC中peerconnection_client程序报LNK2019 无法解析的外部符号错误
- Commodity management - merge purchase demand into purchase order
- What does the mremote variable in servicemanagerproxy refer to?
- Coding style: SSM environment in MVC mode, code hierarchical management
- 推动中国制造升级,汽车装配车间生产流水线3D可视化
- 吴恩达《Machine Learning》精炼笔记 4:神经网络基础 - 知乎
- CCR炒币机器人:新冠肺炎加速了监管机构对CBDC的兴趣
- 上线1周,B.Protocal已有7000ETH资产!
- What's the difference between delete, truncate, and drop, and what to do if you delete data by mistake
猜你喜欢

初级工程师如何在职场生存

Network security engineer Demo: original * * controls your server like this! (2)

【技术教程】Visual Studio 2017自建WebRTC中peerconnection_client程序报LNK2019 无法解析的外部符号错误

Python cookbook 3rd note (2.1): using multiple qualifiers to split strings

《Python Cookbook 3rd》笔记(2.2):字符串开头或结尾匹配

CSDN BUG1: to be added

csdn bug11:待加
![[Python learning manual notes] 001. Preface to Python](/img/c0/b4d34272d3f845ac717d48c669d974.jpg)
[Python learning manual notes] 001. Preface to Python

CCR coin robot: novel coronavirus pneumonia has accelerated the interest of regulators in CBDC.

分布式文档存储数据库之MongoDB索引管理
随机推荐
csdn bug6:待加
Using tail as time series to identify whales
ServiceManagerProxy中mRemote变量指的什么?
Notes on Python cookbook 3rd (2.2): String start or end match
Detach ()
消防知识线上答题活动小程序复盘
Enter C abstract to understand the similarities and differences between abstract classes and interfaces
Ineuos industrial interconnection platform, web configuration (ineuview) increases the function of importing and exporting engineering views, as well as optimization and repair. Release: v3.2.1
Experiment 2
csdn bug10:待加
[leetcode] 92 integer inversion
极验无感验证破解
JMeter interface test -- a solution with token
CCR coin robot: novel coronavirus pneumonia has accelerated the interest of regulators in CBDC.
商品管统——采购需求合并到采购单
Coding style: SSM environment in MVC mode, code hierarchical management
One image can hold 16x16 words! ——Transformers for large scale image scaling recognition (a brief review of ICLR 2021 papers)
Self writing performance testing tool (2)
[elixir! 0073] beam built-in memory database ETS
The length of the last word in leetcode