Problem

Hash FunctionsA good hash function must map equal objects to the same number and shouldpro...

Hash Functions

A good hash function must map equal objects to the same number and shouldproduce as few collisions as possible. Each of the following hash functions maps a person’s surname (a string) to an integer in the range 0…25? Which, if any, of these functions would you classify as a “good” hash function? Explain your answer.

a. The sum of the ASCII values of the characters in the string, mod 26.


b. The alphabetical position of the first character in the string; use 0 for ‘A’, 1 for ‘B’,…, 25 for ‘Z’.


c. The alphabetical position of the last character in the string; use 0 for ‘A’, 1 for ‘B’,…, 25 for ‘Z’.


d. The alphabetical position of either the first or last character in the string. The choice of first or last is random.


e. The number of characters in the string.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 17
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT