What is the Best Second Hash function when using Double Hashing?

佐手、 提交于 2020-01-05 02:55:07

问题


I saw in some of the forums that people used:

7-(key mod 7)  or 6-(key mod 6)  

This is used for computing the second hash function of Double Hashing for any large values of the key.
Is there any importance to the usage of that 6(not even a prime no.) or 7?

Or is it just to randomly generate some value unlike linear probing and quadratic probing?

References:
http://www.java2s.com/Code/Java/Collections-Data-Structure/Hashtablewithdoublehashing.htm http://www.cse.unt.edu/~donr/courses/2050/HashTables.php

来源:https://stackoverflow.com/questions/27225663/what-is-the-best-second-hash-function-when-using-double-hashing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!