Cover Data Structures and Algorithms with Object-Oriented Design Patterns in Java
next up previous contents index

Spreading Keys Evenly

Let tex2html_wrap_inline57368 be the probability that the hash function tex2html_wrap_inline61106. A hash function which spreads keys evenly has the property that for tex2html_wrap_inline61108, tex2html_wrap_inline61110 In other words, the hash values computed by the function tex2html_wrap_inline58138 are uniformly distributed . Unfortunately, in order to say something about the distribution of the hash values, we need to know something about the distribution of the keys.

In the absence of any information to the contrary, we assume that the keys are equiprobable. Let tex2html_wrap_inline61114 be the set of keys that map to the value i. That is, tex2html_wrap_inline61118. If this is the case, the requirement to spread the keys uniformly implies that tex2html_wrap_inline61120. An equal number of keys should map into each array position.


next up previous contents index

Bruno Copyright © 1998 by Bruno R. Preiss, P.Eng. All rights reserved.