Question: 3. Given a hash table with size 7, a hash function hash (x) = x % 7, and keys 5, 7, 14, 1, 19,
3. Given a hash table with size 7, a hash function hash (x) = x % 7, and keys 5, 7, 14, 1, 19, 21. (a) (5 points) Hash the keys using chaining to resolve collisions. Show your work. (b) (5 points) Hash the keys using linear probing to resolve collisions. Show your work. (c) (5 points) Hash the keys using quadratic probing to resolve collisions. Show your work. (d) (5 points) Hash the keys using double hashing to resolve collisions. Suppose the second hash function hash' (x) = 3 - (x % 3). Show your work. (e) (3 points) What is the load factor after the keys are hashed?
Step by Step Solution
There are 3 Steps involved in it
a Hashing the keys using chaining to resolve collisions Hash function hashx x 7 Key 5 Hash value 5 7 5 Key 7 Hash value 7 7 0 Key 14 Hash value 14 7 0 collision with key 7 Key 1 Hash value 1 7 1 Key 1... View full answer
Get step-by-step solutions from verified subject matter experts
