Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

We wish to use a hash Table, T, which stores 30 numbers that range in value from

ID: 3555882 • Letter: W

Question

We wish to use a hash Table, T, which stores 30 numbers that range in value from 0 to 1024. Any of the values in the range are equally likely to occur. We want to determine how many slots we need in the hash table to achieve the desired load factor ( ? ), assuming simple uniform hashing.

How many slots does our hash table need if we want a load factor ? = 2?

How many slots does our hash table need if we want a load factor ? = 3?

To use a hash table with load factor ranging between ? = 2 and ? = 3, what would be a reasonable hash function using the division method?

Explanation / Answer

                    number of stored elements in the table

      load factor =----------------------------------------------------------------------

                                            size of the hash table

1) 2 = 30/slots

slots = 15

2) 3 = 30/slots

slots = 10

3 ) Good hash function would be h(x) = (element)mod37

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote