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

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.

主站蜘蛛池模板: 临安市| 玉环县| 桂林市| 上思县| 宁强县| 绥江县| 武安市| 和林格尔县| 赤水市| 新野县| 灌阳县| 逊克县| 成安县| 康乐县| 丹棱县| 连平县| 莱州市| 砀山县| 股票| 喜德县| 行唐县| 夏河县| 苍梧县| 陈巴尔虎旗| 涞源县| 西充县| 安庆市| 奈曼旗| 桃江县| 读书| 中牟县| 都安| 湖南省| 朝阳市| 新乡县| 台北县| 保靖县| 西安市| 泽库县| 通江县| 益阳市|