官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 亚东县| 上思县| 广安市| 于都县| 桂阳县| 越西县| 西丰县| 古丈县| 雷波县| 石泉县| 高陵县| 普安县| 瑞丽市| 巨鹿县| 西和县| 昭通市| 夹江县| 夹江县| 封开县| 宝山区| 吉安市| 昌江| 海丰县| 友谊县| 嘉峪关市| 余庆县| 那曲县| 分宜县| 五台县| 邛崃市| 焉耆| 深州市| 阆中市| 临汾市| 饶平县| 山西省| 都匀市| 广丰县| 错那县| 五峰| 辽宁省|