Jump to content

Hash Table Linked List Length


Sius

Recommended Posts

A hash table with chaining is required to hold 10000 records. Each record is indexed by the 2-character initials of the user's name, transformed into integers using the mapping: A=01, B=02,...,Z=26. Ideally, on average, no more than 8 comparisons should be made every time a search is requested.

For example, John Doe:

John Doe = JD

J = 10

D = 04

JD = 1004

The hash function (multiplication hash): h(k) = m(kA - kA)

k = 2-character initials as an integer (e.g, 1004)

A = 0.6180339887

m = 1000

In this case, how do you compute the average length of the linked lists, in the hash table, that is pointed to by the hash value slots?

 
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.