In: Computer Science
Data Structures:
Hashing Exercise:
1. a) Given an empty “separate chaining hash table” of size 10, with hash function
Location = Number modulus 10
Show the hash table after inserting the following numbers: 21, 18, 27 , 31 , 48, 51 , 37, 98, 17
b) What table size would be better? 11? 12? 20?
2. We want to hash name strings into a chaining hash table of size 10, how would you divide the alphabet into 10 groups? Hash our class first names into your new Hash table.
3. Given an empty “Open addressing with linear probing hash table”, Show the hash table after inserting the following numbers: 27, 36, 45, 14, 56, 22. What is a good table size?
4. If the expected data size is about 2000, what is a good size for the hash table?
5. Try both linear and quadratic probing in a table of size 10, use the numbers 11, 21, 71, 14, 51
b) If the table size will be 11 then it would be better. Because the total number of elements is only 9.