Surfin’ Safari – Blog Archive & Hashtables, Part 2

One of the more important but somewhat mysterious aspects of hashtables is writing hash functions. A hash function needs to take your data (possibly fixed-size, possibly variable-sized) and turn it into a fixed-size number that has “good distribution”. If you manage this, you won’t get a lot of collisions. This means each hash lookup will have to look at only a few buckets in the table and so will be fast.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s