![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
哈希表
SinclairWang
A very self-motivated person, a very modest man,and also a man does not fear endures hardship.
展开
-
HDU1425 Sort【排序/哈希】
HDU1425 Sort 使用scanf/printf进行输入输出,不然会TLE Sort解法 #include<iostream> #include<algorithm> #include<functional> using namespace std; const int maxn = 1e6+9; int a[maxn]; int main(){ int...原创 2020-04-14 21:57:30 · 214 阅读 · 0 评论 -
PTA字符串关键字的散列映射 (哈希表)
给定一系列由大写英文字母组成的字符串关键字和素数P,用移位法定义的散列函数H(Key)将关键字Key中的最后3个字符映射为整数,每个字符占5位;再用除留余数法将整数映射到长度为P的散列表中。例如将字符串AZDEG插入长度为1009的散列表中,我们首先将26个大写英文字母顺序映射到整数0~25;再通过移位将其映射为3×32^2+4×32+6=3206;然后根据表长得到,即是该字符串的散列映射位置...原创 2020-01-28 15:41:00 · 615 阅读 · 0 评论