Hash Tables


Problems

Problem : Augmenting our current implementation of the hash table, write a delete function to remove a string from the hash table.


Problem : To augment our current implementation, write a function that counts the number of strings stored in the hash table.


Problem : How would we augment our hash table such that it stores information on students? We'd still like to look up a student's name to find them, but we'd then immediately have access to information about them, such as a letter grade, their graduation year, etc.


Problem : If something happened to your code and you accidentally lost your hash function after having stored a lot of data in the hash table, how could you still search for a specific string? What would the search efficiency now be?


Problem : Linear probing is another method for collision avoidance. With linear probing, if a collision occurs, you sequentially look from the current place in the hashtable for the next open spot, and store the string there. What disadvantage does this method have for an insertion in terms of efficiency?


Take a Study Break

SparkLife

Star Trek gets SEXY

Chris Pine and Zoe Saldana heat up the red carpet!

SparkLife

Are you afraid of relationships?

Auntie SparkNotes can help!

SparkLife

Wanna get JLaw's gorgeous glow?

Click here for simple, sexy makeup tricks!

SparkLife

Sexy starlet style

See every single look from the Met Gala!

SparkLife

Who'd be on your zombie-apocalypse crew?

We already dib'sed Genghis Khan.

Geek out!

The MindHut

Geeky Actors: Then and Now

Travel back in time!

The MindHut

Villains We Want These Actresses to Play

From super cute to super bad!

The MindHut

10 Movies Better Than Their Books

What do you think?

The MindHut

How To Look Like J-Law...

When you don't look like J-Law.

The MindHut

12 Scientific Inaccuracies in Into Darkness

What did Star Trek get wrong?

The Book

Cover image

Read What You Love, Anywhere You Like

Get Our FREE NOOK Reading Apps