当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Bartender2021 realizes secure remote label printing, new year-end release
- CSDN bug9: to be added
- [论文阅读笔记] Community-oriented attributed network embedding
- ASP.NET Core framework revealed [blog Summary - continuous update]
- Raspberry pie drum set WiFi
- [paper reading notes] large scale heterogeneous feature embedding
- 【LeetCode】 93 平衡二叉树
- csdn bug11:待加
- 编码风格:Mvc模式下SSM环境,代码分层管理
- 【技术教程】Visual Studio 2017自建WebRTC中peerconnection_client程序报LNK2019 无法解析的外部符号错误
猜你喜欢
史上最全异常检测算法概述
On fedlearner, the latest open source federated machine learning platform of byte
Explanation of Z-index attribute
Coding style: SSM environment in MVC mode, code hierarchical management
推动中国制造升级,汽车装配车间生产流水线 3D 可视化
Android quick shutdown app
痞子衡嵌入式:RT-UFL - 一个适用全平台i.MXRT的超级下载算法设计
极验无感验证破解
Promote China manufacturing upgrade, 3D visualization of production line in automobile assembly workshop
JS solves the problem of automatic pagination in browser printing
随机推荐
[elixir! #0073] beam 内置的内存数据库 —— ETS
Bartender2021实现安全远程标签打印,年终全新发布
自己上手写性能测试工具(二)
Coding style: SSM environment in MVC mode, code hierarchical management
Overview of the most complete anomaly detection algorithm in history
csdn bug9:待加
Use call, apply and bind to solve the annoying this in JS, this in event binding and parameter passing
Mongodb index management of distributed document storage database
Hong Kong listed companies transfer cards to acquire 42.5% equity of chuangxinzhong and plan to speed up the distribution of marketing services
What's the difference between delete, truncate, and drop, and what to do if you delete data by mistake
OSChina 周二乱弹 —— 我养的绿植分别为土豆,生姜,蒜
寻找性能更优秀的不可变小字典
区块链论文集【三十一】
解决Coursera视频无法观看的三种方法(亲测有效)
csdn bug11:待加
Thinking about competitive programming: myths and shocking facts
Getiservicemanager () source code analysis
ServiceManagerProxy中mRemote变量指的什么?
Using tail as time series to identify whales
吴恩达《Machine Learning》精炼笔记 4:神经网络基础 - 知乎