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

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.

主站蜘蛛池模板: 堆龙德庆县| 松溪县| 和田县| 门源| 山东| 南城县| 安国市| 连州市| 五河县| 嘉善县| 鄯善县| 晋江市| 府谷县| 龙泉市| 施秉县| 东丽区| 孝感市| 防城港市| 泰州市| 宁陕县| 达日县| 宝丰县| 静海县| 浑源县| 巩义市| 梅州市| 娄底市| 沐川县| 宿州市| 云和县| 永泰县| 靖安县| 寿光市| 鹤壁市| 广平县| 尼玛县| 泸州市| 新晃| 文昌市| 丰县| 黄浦区|