使用时候需要#include <unordered_set>
定义:unordered_set<int> myset;
存入unordered_set 之中是不重复的数。
使用函数:
- myset.insert(c);//插入某个值
- it = myset.find(c);
当 it==myset.end(),说明没有找到 - myset.erase(c)//去掉某个值
最后
以上就是粗犷飞机最近收集整理的关于C++中的unordered_set的全部内容,更多相关C++中内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复