unordered_set c++
时间: 2023-11-02 10:22:21 浏览: 82
C++ 不规则窗口
unordered_set c是一个无序集合容器,它可以存储不重复的元素,并且能够以常数时间的复杂度进行插入、删除和查找操作。在C++中,使用unordered_set需要引入头文件<unordered_set>。
unordered_set的find函数用于在容器中搜索指定值的元素,如果找到则返回指向该元素的迭代器,否则返回指向unordered_set::end的迭代器,表示未找到。insert函数用于向unordered_set中插入元素,返回一个迭代器,该迭代器要么指向容器中新插入的元素,要么指向键值相等的元素。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [C++11:关联式容器:unordered_set](https://blog.csdn.net/qq_59535638/article/details/131105769)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [C++常用语法——unordered_set](https://blog.csdn.net/LiuXF93/article/details/120899401)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文