STL unordered_set
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;
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的更多相关文章
- STL:unordered_set/unordered_multiset(c++11)
unordered_set:容器内的元素无序排列,基于值进行获取单个元素速度非常快.内部根据它们的 hash value 被组织成 buckets(slot). unordered_multiset: ...
- 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 ...
- STL容器(C11)--unordered_set用法
http://www.cplusplus.com/reference/unordered_set/
- STL标准库-容器-unordered_set
技术在于交流.沟通,本文为博主原创文章转载请注明出处并保持作品的完整性 unordered_set与与unordered_map相似,这次主要介绍unordered_set unordered_set ...
- STL ——map、set、unordered_map、unordered_set
1.map和set map和set底层实现均是红黑树 map支持下标操作,set不支持下标操作. set的迭代器是const的,不允许修改元素的值:map允许修改value,但不允许修改key. se ...
- c++ STL之unordered_set
unordered_set的特点: 自身值就是主键,所以值唯一并且不可修改 基于hash表的无序排列 unordered_set基于哈希表,是无序的. 在一个 unordered_set 容器中,元素 ...
- C++ STL之unordered_map和unordered_set的使⽤
写在最前面,本文摘录于柳神笔记: unordered_map 在头⽂件 #include <unordered_map> 中, unordered_set 在头⽂件 #include &l ...
- 1.1 STL 概述
综述 STL = Standard Template Library,标准模板库,惠普实验室开发的一系列软件的统称.它是由Alexander Stepanov.Meng Lee和David R M ...
- c++ 标准库的各种容器(vector,deque,map,set,unordered_map,unordered_set,list)的性能考虑
转自:http://blog.csdn.net/truexf/article/details/17303263 一.vector vector采用一段连续的内存来存储其元素,向vector添加元素的时 ...
随机推荐
- Bootstrap--组件之下拉菜单
用于显示链接列表的可切换.有上下文的菜单. 对齐 B默认情况下,下拉菜单自动沿着父元素的上沿和左侧被定位为 100% 宽度. 为 .dropdown-menu 添加 .dropdown-menu-ri ...
- 16Aspx.com源码2014年7月详细
Web电子商务网(三层)V2.0源码 2014-07-31 [VS2010] 源码介绍: Web电子商务网(三层)V2.0源码 源码描述: 一.源码特点 采用三层架构开发, ...
- Android手机出现"已安装了存在签名冲突的同名数据包"的原因及解决办法
http://blog.csdn.net/dyllove98/article/details/8830264 如果你不是开发者:如果你在android上更新一个已经安装过较早版本软件时,安装到最后一步 ...
- JDBC中事务的使用
http://blog.sina.com.cn/s/blog_6f3ca78f01010pmj.html 当Jdbc程序向数据库获得一个Connection对象时,默认情况下这个Connection对 ...
- MinGW-notepad++开发c/c++程序
下载MinGW 点击下载 安装好后运行 最后点击左上角的 Installation,开始安装 1.编译: g++ -o a.exe a.cpp gcc -o hello.exe hello.c 2.运 ...
- Oracle 10g 默认安装带来的用户名/密码
ORACLE数据库创建的时候,创建了一系列默认的用户和表空间 Oracle 10g 默认安装带来的用户名/密码 Username Password Description See Also CTXSY ...
- Windows server 2003常用设置
1.禁用配置服务器向导 由于不需要服务器设置功能,首先我们先禁止“配置你的服务器”(Manage Your Server)向导的出现,你可以在控制面板(Control Panel) ...
- java 利用注解实现BaseDao 增删查改
第一步,编写两个注解类,用于表明实体类对应的表名及字段. TableInfo.java 此注解用于标注表名及主键名 import static java.lang.annotation.Element ...
- 【技术·水】浅谈Dism++清理插件开发
前言 昨天我发布了NCleaner,一款Dism++清理插件(地址:http://bbs.pcbeta.com/viewthread-1692182-1-1.html) 有些人想要我开源NCleane ...
- bzoj1478:Sgu282 Isomorphism
思路:由于题目中是通过改变点的编号来判断两种染色方案是否相同,而染色的确是边,于是考虑如何将点置换转化为边置换. 对于一个有n个点的完全图,其点置换有n!个(即全排列个数),又由于每一个边置换都对应了 ...