Hashing with Linear Probing
CS361: Advanced Data Structures and Algorithms
Algorithm Animation
November 1999
Quick instructions:
-
when the animation window appears, select desired operations from the Algorithm
menu.
-
When execution pauses inside of an algorithm, press the continue
button to resume.
Things to Try:
This is a hash table of strings. A poor hash function has been
deliberately chosen so that you can easily see the effects of collisions: the hash function is simply the length of the string.
- Try adding strings of varying length and of the same length to force collisions.
- Try searching for and erasing strings. Note the difference between an empty slot and a deleted one when searching and inserting.
- For example, starting with an empty table try inserting the strings "Adams", "Baker", and "Cooper", then erase "Baker".
Now search for "Cooper" and "Baker". Then add "Davis".
Email me at zeil@cs.odu.edu
This animation was prepared using the AlgAE animation framework.
AlgAE applets run under Microsoft
Internet Explorer 4.0 (or later) and Netscape
Communicator 4.05 (or later).