- 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.
推薦閱讀
- Java逍遙游記
- scikit-learn Cookbook
- x86匯編語言:從實(shí)模式到保護(hù)模式(第2版)
- INSTANT Sencha Touch
- Hadoop+Spark大數(shù)據(jù)分析實(shí)戰(zhàn)
- 精通Python設(shè)計模式(第2版)
- Learning Salesforce Einstein
- 移動界面(Web/App)Photoshop UI設(shè)計十全大補(bǔ)
- ANSYS Fluent 二次開發(fā)指南
- Spring核心技術(shù)和案例實(shí)戰(zhàn)
- Mastering Python Design Patterns
- 代替VBA!用Python輕松實(shí)現(xiàn)Excel編程
- Spring 5 Design Patterns
- 單片機(jī)原理及應(yīng)用技術(shù)
- 軟件工程與UML案例解析(第三版)