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. Oracle+FluentData+MVC4+EasyUI开发权限管理系统之开篇

    在园子里有很多EF+MVC+EasyUI的框架实在是太多了,经过在一段时间的学习高手写的思路,但是都是针对Sql数据的,但是今年我当上研发组组长的第一个任务就是编写一个通用平台框架,一刚开始想把学习过 ...

  2. 如何创建windows xp 虚拟机

         如何创建windows xp 虚拟机 一.所需软件 1. VMware-workstation-full-12.0.0-2985596 赠送vm12 激活key一枚: 5A02H-AU243 ...

  3. JQuery Jplayer play无效的问题

    最近折腾个H5. 用到Jplayer, 用着不错,至少兼容性强一些. 但是安卓这辆公共汽车型号实在太多.不小心上了一辆奇葩的就容易震到生活不能自理. 我在一台手机上的五六个浏览器上测试,都可以. 把该 ...

  4. eclipse Ctrl+1 没反应

    今天上午写代码,突然发现Ctrl+1没反应了,顿时无语.昨天还好好的,今天就不行了…… 无奈,只好在网上查了查,据说快捷键冲突的原因比较大. 于是我将Ctrl+1换成了Alt+1.在eclipse中测 ...

  5. WildFly 9.0.2 + SQLServer + BIRT + JNDI 处理BIRT报表发布时数据源的修改

    一.前提需求说明: 最近在做项目的时候使用jboss WildFly发布BIRT报表,在报表中我是直接添加的JDBC数据源,通过Database URL .用户名和密码连接数据库.后来在部署到正式和测 ...

  6. sql 常用操作脚本代码

    ,--运行fy_mh库[use] use fy_mh ,--查询 mh_dblj表 select * from mh_dblj ,--更新 某个字段(把表的某个字段下的所有的数据清空)[update ...

  7. C# 中使用win32函数 GetScrollInfo返回false 返回引用全是零的问题

    最近做一个项目要获得ScrollBar的位置,因为.net找不到此类功能,只好用MFC中的函数了,GetScrollPos只返回listview顶部的位置,此时我找到了GetScrollInfo,觉得 ...

  8. 13_输出映射1_resultType

    输出映射主要有两种:resultType和resultMap [resultType] 可以返回三种类型 pojo对象:例如select * from user where id=? pojo对象列表 ...

  9. java编程思想,对象导论

    程序设计的本质就是使用编程语言解决某一类具体问题.对问题的定义叫建模,例如定义问题域中的各种名词,动作,结果等.针对具体的问题提出的解决方案叫算法. 面向对象程序设计的挑战之一,就是在问题空间的元素和 ...

  10. 【原创】Linux 内核模块编程

    sudo gedit hello.c #include <linux/module.h> #include <linux/kernel.h> #include <linu ...