next up previous contents index Search
Next: 0.2.7.4 Source Code Up: 0.2.7 Hashing Previous: 0.2.7.2 Dealing with Collisions

0.2.7.3 Choosing a Table Size

When choosing a table size you are, again, weighing options. The smaller the table you use, the faster the access times will be. However, if you use too small a table the probability of a collision occurring increases. As mentioned in the previous section, if you are using the division method for calculating hash function value, the hash table size should be a prime number. The multiplication method relies on a hash table size that is a power of two.      

Scott Gasch
1999-07-09