Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Double hashing
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Selection of h<sub>2</sub>(k)== The secondary hash function <math>h_2(k)</math> should have several characteristics: * It should never yield an index of zero. * It should cycle through the whole table. * It should be very fast to compute. * It should be pair-wise independent of <math>h_1(k)</math>. * The distribution characteristics of <math>h_2</math> are irrelevant. It is analogous to a random-number generator. * All <math>h_2(k)</math> should be ''relatively prime'' to |''T''|. In practice: * If division hashing is used for both functions, the divisors are chosen as primes. * If |''T''| is a power of 2, the first and last requirements are usually satisfied by making <math>h_2(k)</math> always return an odd number. This has the side effect of doubling the chance of collision due to one wasted bit.<ref name=Dillinger04/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)