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?


Take a Study Break

Green YOUR SCHOOL!

Click here to get involved with dosomething.org!

John Krasinski's BIG MIRACLE

Click to watch the trailer and read exclusive star interviews!

Do you like Anna?

Read Dear Albert... from ANNA's perspective!

BATTLESHIP, the movie

Here's why we're super jazzed about it.

Do energy juices actually work?

Our blogger puts 'em to the test!


The Book

Cover image

Read What You Love, Anywhere You Like

Get Our FREE NOOK Reading Apps