Question: ( a ) [ 5 pts ] How do we go about picking a good hash function and hash structure? Provide some general guidelines about
a pts How do we go about picking a good hash function and hash structure? Provide some general guidelines about what a hash designer needs to think about.
b pts What is the worst case runtime of insertion into a hash table using chaining linked list Please explain.
c pts What is the worst case runtime of successful insertion into a hash table using linear probing a form of open addressing Please explain
d pts There are two hash functions that take in strings as input shown below. Each returns an integer in between and Note: is a prime number. Which of these two is a better hash function?
Explain the weakness in the other function.
int fchar str
int i res ;
while str i
O s
res res intstr i;
i;
return res:
int fchar str
int i res ;
while str i
S
res res intstr i;
:
return res;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
