Home > SparkNotes > Computer Science Study Guides > Hash Tables >

sparknotes

Hash Tables


Problems

Problem : What are the four requirements for a good hash function?


Problem : Why should a good hash function satisfy these rules?


Problem : 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;
}


Problem : 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?


Problem : What other applications of hash functions can you think of besides hash tables?