Hash Function

When we have m < |U|, we need some way of shoe-horning the universe into the table.

A hash function $h:U\rightarrow [0,m-1]$ does this for us.

The hash value of an object $k\in U$ is h(k).

A perfect hash function has the property that all the inserted objects K have a unique hash value.

For a perfect hash function h:

Acts just like the direct-address table: everything O(1) worst case.


next up previous
Next: Collisions Up: HASHING BASICS Previous: Extending Tables