Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
再好的hash函数也避免不了重复, 否则散列法的研究者们都是吃饱撑着吗...In Reply To:这题竟然可以发现标准hash的bug...... Posted by:alawing at 2008-11-26 15:06:19 > 经过我提交本题20+次 > 加上搜索网上数据得出 > int ELFhash(char* key) > { > unsigned long h = 0; > while(*key) > { > h = (h<<4) + *key++; > unsigned long g = h & 0Xf0000000L; > if(g) > h ^= g >> 24; > h &= ~g; > } > return h % M; > } > 这个hash算法有覆盖= =; > 例如eeeeeefvnb eeeeeegfnb这2个hash值竟然一样(函数里h算出来的就一样) > 厄。。。。。 > Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator