0
点赞
收藏
分享

微信扫一扫

常见的三种哈希结构

朱悟能_9ad4 2022-01-23 阅读 44

1、数组

2、set(集合)

3、map(映射)

如果限制数组长度,就可以用数组来替代哈希表;若哈希值数量少、分散,则数组会造成很大的空间浪费,因此可以使用set。

对于set,C++有set、multiset、unordered_set

对于map,C++有map、multimap、unordered_map

unordered_set和unordered_map详细用法可见下方博客

C++ STL 之 unordered_set 使用(包括unordersd_map)_无痕眼泪的博客-CSDN博客_unordered_set

举报

相关推荐

0 条评论