- 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.
推薦閱讀
- LabVIEW Graphical Programming Cookbook
- Testing with JUnit
- JavaScript語言精髓與編程實踐(第3版)
- Vue.js快跑:構(gòu)建觸手可及的高性能Web應(yīng)用
- 數(shù)據(jù)結(jié)構(gòu)(Java語言描述)
- Hands-On JavaScript High Performance
- Android 應(yīng)用案例開發(fā)大全(第3版)
- Access 2010數(shù)據(jù)庫應(yīng)用技術(shù)(第2版)
- Mastering Data Mining with Python:Find patterns hidden in your data
- 零代碼實戰(zhàn):企業(yè)級應(yīng)用搭建與案例詳解
- OpenCV Android開發(fā)實戰(zhàn)
- Mastering Apache Camel
- Keil Cx51 V7.0單片機高級語言編程與μVision2應(yīng)用實踐
- Java編程指南:語法基礎(chǔ)、面向?qū)ο蟆⒑瘮?shù)式編程與項目實戰(zhàn)
- ASP.NET Core 2 High Performance(Second Edition)