- Mastering C++ Programming
- Jeganathan Swaminathan
- 127字
- 2021-07-02 18:28:53
Unordered sets
An unordered set works in a manner similar to a set, except that the internal behavior of these containers differs. A set makes use of red-black trees while an unordered set makes use of hash tables. The time complexity of set operations is O( log N) while the time complexity of unordered set operations is O(1); hence, the unordered set tends to be faster than the set.
The values stored in an unordered set are not organized in any particular fashion, unlike in a set, which stores values in a sorted fashion. If performance is the criteria, then an unordered set is a good bet; however, if iterating the values in a sorted fashion is a requirement, then set is a good choice.
推薦閱讀
- 流量的秘密:Google Analytics網(wǎng)站分析與優(yōu)化技巧(第2版)
- Spring Cloud Alibaba微服務(wù)架構(gòu)設(shè)計(jì)與開(kāi)發(fā)實(shí)戰(zhàn)
- Android Native Development Kit Cookbook
- Modular Programming in Java 9
- 大模型RAG實(shí)戰(zhàn):RAG原理、應(yīng)用與系統(tǒng)構(gòu)建
- Python編程:從入門(mén)到實(shí)踐
- AIRIOT物聯(lián)網(wǎng)平臺(tái)開(kāi)發(fā)框架應(yīng)用與實(shí)戰(zhàn)
- 一塊面包板玩轉(zhuǎn)Arduino編程
- Visualforce Developer’s guide
- Learning Material Design
- 時(shí)空數(shù)據(jù)建模及其應(yīng)用
- 動(dòng)手打造深度學(xué)習(xí)框架
- 從Excel到Python數(shù)據(jù)分析:Pandas、xlwings、openpyxl、Matplotlib的交互與應(yīng)用
- DevOps 精要:業(yè)務(wù)視角
- Qt 5.12實(shí)戰(zhàn)