天天看點

pb_ds中的hash_table

pb_ds中的hash_table

參考:​​ pd_ds中的hash ​​

需要的頭檔案和命名空間:

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
using namespace __gnu_pbds;      

​hash_table​

​:

cc_hash_table<int,bool>h;
gp_hash_table<int,bool>h;      

cc_hash_table是拉鍊法

gp_hash_table是查探法

一般來說查探法會快一些