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添加元素的时 ...
随机推荐
- photoshop 常用快捷键大全
一.文件新建 CTRL+N打开 CTRL+O 打开为 ALT+CTRL+O关闭 CTRL+W保存 CTRL+S 另存为 CTRL+SHIFT+S另存为网页格式 CTRL+ALT+S打印设置 CTRL+ ...
- zzzzw_在线考试系统②管理员篇章
今天实现了管理的功能,谈谈遇到的问题!我先上图 图一 管理员的数据库 在action中访问Servlet API的非IoC方式之一:使用apache.struts2.ServletActionCo ...
- Activiti工作流引擎使用
http://www.kafeitu.me/activiti/2012/03/22/workflow-activiti-action.html 1.简单介工作流引擎与Activiti 对于工作流引擎的 ...
- 学习笔记_过滤器应用(粗粒度权限控制(拦截是否登录、拦截用户名admin权限))
RBAC ->基于角色的权限控制 l tb_user l tb_role l tb_userrole l tb_menu(增.删.改.查) l tb_rolemenu 1 说明 我们给 ...
- mysql笔记之主从切换
一. 正常切换 1)从服务器检查SHOW PROCESSLIST语句的输出,直到你看到Has read all relaylogwaiting for the slave I/O thread to ...
- linux系统防火墙对访问服务器的影响
一.刚部署好的linux服务器默认开启了防火墙,这时假如你在该服务器装一个tomcat并启动,在别的机器访问该tomcat是不成功的.需要关闭服务器防火墙才可以 二.service iptables ...
- javascript 笔记(1)
document.forms[0].names.value == '' forms[0]表示文档的第一个 form 表单,names 表示这个表单元素名为 names 的表单的元素,此时表示的是获取此 ...
- CI源码学习 一步一步重写 CodeIgniter 框架
文章:http://www.cnblogs.com/zhenyu-whu/archive/2013/08.html
- PHP 自 5.2 到 5.6 中新增的功能详解
截至目前(2014.2), PHP 的最新稳定版本是 PHP5.5, 但有差不多一半的用户仍在使用已经不在维护 [注] 的 PHP5.2, 其余的一半用户在使用 PHP5.3 [注].因为 PHP 那 ...
- MAC 终端快捷建
常用的快捷键: Ctrl + d 删除一个字符,相当于通常的Delete键(命令行若无所有字符,则相当于exit:处理多行标准输入时也表示eof) Ctrl + h 退格删 ...