|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Problems
Problem 2.1:
What are the four requirements for a good hash function?
[Solution]
Problem 2.2:
Why should a good hash function satisfy these rules?
[Solution]
Problem 2.3:
Describe how the following hash function violates the four rules for a
good hash function.
int hash(char *data, int table_size)
{
return 220 % table_size;
}
[Solution]Problem 2.4:
Why do most hash functions return a non-negative integer hash value?
In other words, why wouldn't a hash function return a string or a double?
[Solution]
Problem 2.5:
What other applications of hash functions can you think of besides hash tables?
[Solution]
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contact Us | Privacy Policy | Terms and Conditions | About
©2006 SparkNotes LLC, All Rights Reserved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||