http://www.cplusplus.com/reference/unordered_set/unordered_set/

template < class Key,                        // unordered_set::key_type/value_type
class Hash = hash<Key>, // unordered_set::hasher
class Pred = equal_to<Key>, // unordered_set::key_equal
class Alloc = allocator<Key> // unordered_set::allocator_type
> class unordered_set;
stl里面的set包含了排序的数据,这些数据的值value必须是唯一的。multiset(多重集)——和集合(set)相似,然而其中的值不要求必须是唯一的(即可以有重复)
Unordered Set

Unordered sets are containers that store unique elements in no particular order, and which allow for fast retrieval of individual elements based on their value.

unordered_set是存储独一的元素,没有按照特别的顺序。

In an unordered_set, the value of an element is at the same time its key, that identifies it uniquely. Keys are immutable, therefore, the elements in an unordered_set cannot be modified once in the container - they can be inserted and removed, though.

Internally, the elements in the unordered_set are not sorted in any particular order, but organized into buckets。depending on their hash values to allow for fast access to individual elements directly by their values (with a constant average time complexity on average).

unordered_set containers are faster than set containers to access individual elements by their key, although they are generally less efficient for range iteration through a subset of their elements.

Iterators in the container are at least forward iterators.

STL unordered_set的更多相关文章

  1. STL:unordered_set/unordered_multiset(c++11)

    unordered_set:容器内的元素无序排列,基于值进行获取单个元素速度非常快.内部根据它们的 hash value 被组织成 buckets(slot). unordered_multiset: ...

  2. STL set multiset map multimap unordered_set unordered_map example

    I decide to write to my blogs in English. When I meet something hard to depict, I'll add some Chines ...

  3. STL容器(C11)--unordered_set用法

    http://www.cplusplus.com/reference/unordered_set/

  4. STL标准库-容器-unordered_set

    技术在于交流.沟通,本文为博主原创文章转载请注明出处并保持作品的完整性 unordered_set与与unordered_map相似,这次主要介绍unordered_set unordered_set ...

  5. STL ——map、set、unordered_map、unordered_set

    1.map和set map和set底层实现均是红黑树 map支持下标操作,set不支持下标操作. set的迭代器是const的,不允许修改元素的值:map允许修改value,但不允许修改key. se ...

  6. c++ STL之unordered_set

    unordered_set的特点: 自身值就是主键,所以值唯一并且不可修改 基于hash表的无序排列 unordered_set基于哈希表,是无序的. 在一个 unordered_set 容器中,元素 ...

  7. C++ STL之unordered_map和unordered_set的使⽤

    写在最前面,本文摘录于柳神笔记: unordered_map 在头⽂件 #include <unordered_map> 中, unordered_set 在头⽂件 #include &l ...

  8. 1.1 STL 概述

    综述   STL = Standard Template Library,标准模板库,惠普实验室开发的一系列软件的统称.它是由Alexander Stepanov.Meng Lee和David R M ...

  9. c++ 标准库的各种容器(vector,deque,map,set,unordered_map,unordered_set,list)的性能考虑

    转自:http://blog.csdn.net/truexf/article/details/17303263 一.vector vector采用一段连续的内存来存储其元素,向vector添加元素的时 ...

随机推荐

  1. HTML5 PC、Mobile调用摄像头(navigator.getUserMedia)

    废话少说,先贴上代码 html: <div id="main" class="masthead"> <div id="face_sc ...

  2. 不需要软件让Windows7变身WIFI热点

    很简单,就是把一台装有windows 7操作系统,并配有无线网卡的电脑变成一台无线路由器或无线AP,以便在没有路由器的环境中实现多台无线终端(比如支持wifi的手机.电脑等设备)共享无线网络.那么我们 ...

  3. IOS_OC_本地推送知识总结

    知识点介绍 一. 推送通知介绍(了解) 二. 本地推送通知 本地通知的基本使用 本地通知的不常用属性 删除重复的通知 通知的处理1-跳转界面 通知的处理2-程序退出 分类的设置/快捷回复 一. 推送通 ...

  4. Swift 学习手记1,pod 的 类库使用

    问题: 在Swift中,我们无法使用像Objective-c 一样的 #import 例如 在头部输入 #import <ReactiveCocoa/ReactiveCocoa.h> 是不 ...

  5. JavaScript之String()和.toString()

    JS中 转换字符串的方法有两个 一个String(),一个.toString(). 通常情况下 这两种使用没有太大的区别.但是需要注意几点: undefined: toString() var tes ...

  6. Angular2中的host

    要将Angular组件渲染成DOM中的某种东西,你需要在Angular组件中结合一个DOM元素,我们称这些叫host元素. 一个组件可以用以下方式于其host DOM元素进行交互 它可以监听其事件. ...

  7. 转JSONObject put,accumulate,element的区别

        public Object put (Object key, Object value) 将value映射到key下.如果此JSONObject对象之前存在一个value在这个key下,当前的 ...

  8. 页面mask css

    <html> <head> <style type="text/css"> .share_mask { position: fixed; top ...

  9. yum 安装 依赖报错

    今天使用yum安装的时候 报错: Error: Multilib version problems found. This often means that the root cause 应该是yum ...

  10. tp_shop解读1

    由于想弄一个商城,因此研究了一下tp_shop,这个据说能完成几乎所有的功能. 考虑到原有的例子过于复杂,因此把所有相关的数据都删除了,结果上来就出错了,查了两天,大致弄清楚了状况. 关于错误的原因 ...