next up previous contents index Search
Next: Source Code Up: 0.2.7 Hashing Previous: Dealing with Collisions 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