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添加元素的时 ...
随机推荐
- java Spring 生命周期
1.初始化回调 <bean name="userService" class="com.sun.service.UserService" init-met ...
- oracle11g不能导出空表
Oracle11g的数据库迁移,习惯性的用了exp/imp,然后在新的数据库发现,空表根本没有exp出来,然后查资料,发现了如下信息: ORACLE 11G在用EXPORT导出时,空表不能导出. 11 ...
- JS获取日期和时间
//获取日期和时间 function showDate(){ var myDate = new Date(); myDate.getYear(); //获取当前年份(2位) myDate.getFul ...
- C#查询当前微信自定义菜单结构
查询 string access_token = "你的token"; string posturl = "https://api.weixin.qq.com/cgi-b ...
- 【转】iOS开发——基本常识篇&各种控件默认高度
原文:http://www.cnblogs.com/iCocos/p/4595614.html 各种控件默认高度 1.状态栏 状态栏一般高度为20像素,在打手机或者显示消息时会放大到40像素高,注 ...
- DAG模型——嵌套矩阵
有向无环图上的动态规划是学习动态规划的基础,很多问题都可以转化为DAG上的最长路.最短路或路径计数问题. 嵌套矩阵 有n个矩阵,每个矩阵可以用两个整数a,b描述,表示它的长和宽.矩阵X(a,b)可以嵌 ...
- QT 自定义assert
预览 代码 #define assert_(expression,message) if (expression) \ { \ if (QMessageBox::Yes == QMessageBoxE ...
- 模板:优先队列(priority_queue)
#include <iostream> #include <cstdio> #include <queue> #include <vector> usi ...
- android studio 自动序列化类插件
https://github.com/mcharmas/android-parcelable-intellij-plugin
- jQuery插件综合应用(一)注册
一.介绍 注册和登录是每个稍微有点规模的网站就应该有的功能.登陆功能与注册功能类似,也比注册功能要简单些.所以本文就以注册来说明jQuery插件的应用. jQuery插件的使用非常简单,如果只按照jQ ...