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

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.

主站蜘蛛池模板: 台南市| 蓝山县| 闽清县| 金华市| 宣武区| 英德市| 甘肃省| 青浦区| 德阳市| 富蕴县| 新沂市| 高淳县| 民县| 浪卡子县| 乳山市| 望谟县| 三江| 东海县| 龙海市| 广水市| 永平县| 建平县| 准格尔旗| 徐州市| 宣化县| 嘉义市| 叙永县| 海安县| 台南市| 德昌县| 江永县| 武乡县| 沙雅县| 项城市| 鄂托克前旗| 晋城| 霍州市| 安宁市| 昆山市| 惠东县| 介休市|