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)_无痕眼泪的博客-优快云博客_unordered_set