- 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.
推薦閱讀
- DB2 V9權威指南
- Microsoft Exchange Server PowerShell Cookbook(Third Edition)
- C#程序設計教程
- oreilly精品圖書:軟件開發者路線圖叢書(共8冊)
- C語言從入門到精通(第4版)
- Python數據可視化之Matplotlib與Pyecharts實戰
- 青少年Python編程入門
- D3.js 4.x Data Visualization(Third Edition)
- 常用工具軟件立體化教程(微課版)
- 詳解MATLAB圖形繪制技術
- Django 3.0應用開發詳解
- Scala Functional Programming Patterns
- Puppet:Mastering Infrastructure Automation
- 你真的會寫代碼嗎
- 信息安全技術(第2版)