#include <string>
#include <iostream>
//查询性能最高(不允许重复数据)
#include <unordered_set>
using namespace std; void main()
{
unordered_set<string> myset{"move","jump","hello"}; //删除hash表第一个
//myset.erase(myset.begin()); //删除某一个
myset.erase("move"); myset.insert("hel1"); for (auto i : myset)
{
cout << i << endl;
}
for (auto ib = myset.begin(), ie = myset.end(); ib != ie; ib++)
{
cout << *ib << endl;
}
//哈希表长度
cout << myset.bucket_count() << endl; //输出hash表内存结构
for (int i = ; i < myset.bucket_count(); i++)
{
cout << "bucket" << i << ": ";
for (auto it = myset.begin(i); it != myset.end(i); it++)
{
cout << " " << *it;
}
cout << endl;
} //最大大小
cout << myset.max_size() << endl;
//当前大小
cout << myset.size() << endl;
cin.get();
}

最新文章

  1. 【232】◀▶ IDL显示地理图像
  2. SQL查询中in、exists、not in、not exists的用法与区别
  3. qt 的简介与使用
  4. iOS 开发 初级:应用内购买 In-App Purchase
  5. Effective C++ -----条款45:运用成员函数模板接受所有兼容类型
  6. 用Visual Studio调试Windows和驱动程序
  7. 修改php执行用户,并使其拥有root权限
  8. [原创]PostgreSQL Plus Advince Server在 HA环境中一对多的Stream Replication配置(二)
  9. MKDOCS在线文档编辑器
  10. eclipse设置系统字体
  11. 编写优秀jQuery插件的10个技巧
  12. sed高级命令
  13. PGA与SGA
  14. 节点操作,节点属性的操作及DOM event事件
  15. Haproxy 安装及配置
  16. DDMS调试工具
  17. 从CMDB动态获取服务器列表,按照Ansible的约定
  18. 064——VUE中vue-router之使用路由别名定制(alias)
  19. JSON定义及应用
  20. SEO优化:WordPress发布文章主动推送到百度,加快收录保护原创

热门文章

  1. [Angular] Read Custom HTTP Headers Sent by the Server in Angular
  2. Remove Duplicates from Sorted List II 解答(有个比較特殊的case leetcode OJ没有覆盖)
  3. SQL学习之使用order by 依照指定顺序排序或自己定义顺序排序
  4. caffe环境配置
  5. sql server执行动态拼接sql(带传参数)和去掉小数点后0的函数
  6. MyLayer MyScene
  7. Python之Linux下的virtualenv
  8. javaBean 练习—封装学生信息
  9. RocketMQ学习笔记(9)----RocketMQ的Producer 顺序消息
  10. ZBrush中Zproject与SubTool的综合应用