Hashing Answers - On the other hand if a=1 then strings...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Answers to Self-Study Questions for Hashing Test Yourself #1 Here is the result of the hash function: and the hash table, after all the stores is: Test Yourself #2 If you take the product of a series of numbers and any value in the series is 0 then the entire product will be zero. Thus, if a=0, then any string containing “a” will have the hash function return 0. This is undesirable since many strings will hash to the same index (0) in the hash table.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: On the other hand, if a=1, then strings with the letter “a” will hash to many different locations, depending on the other characters in the string. This is the desired situation and is better. Name Sum of Characters hash(name) George 57 7 Amy 39 9 Alan 28 8 Sandy 63 3 Page 1 of 1 Answers to Self-Study Questions for Hashing 2008/3/27 http://pages.cs.wisc.edu/~cs367-1/topics/Hashing/answers.html...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online