Question: Explain each answer. 3. Consider the same setting as above. The only change is, now the keys are all ASCII strings of length 32, instead

 Explain each answer. 3. Consider the same setting as above. The

Explain each answer.

3. Consider the same setting as above. The only change is, now the keys are all ASCII strings of length 32, instead of integers. Which of the following hash function will NOT work? a) h(k)- (sum of the ASCII values of all the characters) mod N b) h(k) - (i kil 128) mod N, where 0 sis 31, and kli] represent the ith character in string k. c) h(k) - (ASCII value of k[i])/4, where ' is randomly chosen, O s is 31, kli] represent the ith character in string k, and ASCII values are in the range [O, 255] d) All the hash functions defined above will not work (in this problem) e) All the hash functions defined above will work (in this problem) 4. You are given a hash table which allows collision. Each slot of the hash table actually keeps a linked list, and whenever a collision occurs the new element is added to the tail of the list. Suppose, you have total M elements, and the hash table is of size N. Let's assume the hash function generates hash values i-h(k) which look almost random. What is the expected running time (not the worst-case running time) for a search operation? a) O(log M) b) O(log N) c) O(M/N)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!