Find It Fast: Hash Tables and Collision Resolution
CSEF · 2009 Mathematics & Software Third Award
Overview
Objectives/Goals Hash tables are an efficient method for data storage and access. They allow accessing data without extensive search. When two keys hash to the same location, a collision resolution algorithm is used to determine where the keys should be placed. I studied three collision resolution algorithms (CRAs): linear probing, linked list, and cellar. My hypothesis was that all three hash table CRAs would perform about equally well, and all much better than a simpler linear search method. Methods/Materials I measured time, memory usage, and number of string comparisons (as a more precise proxy for time) on 50 different inputs for these three hash methods and for linear search. Results As expected, hashing was a hundred times faster than linear search, taking 0.35-0.5 seconds to look up the approximately one million words of the Bible, instead of 45 seconds for linear search. Conclusions/Discussion The cellar and linked list CRAs always performed well. Contrary to my hypothesis, linear probing sometimes performed poorly when it didn't rehash until the table was full. Rehashing when the table was only 70% full allowed linear probing to perform on par with linked list and cellar.
Summary statement
I programmed and measured the performance of three collision resolution algorithms for hash tables.
Help received
Father taught me C, gave some help in debugging code, and helped create Makefile. Parents and teacher provided feedback on report.
Awards (1)
Competition history
- CSEF 2009
Resources
Related projects
CSEF · 2016
Digital Fingerprints: Constructing One-Way Hash Functions
CSEF · 2007
Awesome Algorithms
CSEF · 2002
The Double-Array Sort: A Study of C++ Sorting Methods
CSEF · 2013
A Computational Exploration of Quadratic Residues and Their Applications
CSEF · 2011
Sorting Algorithms
CSEF · 2008
The Efficiency of Prime-Testing Algorithms
CSEF · 2010
Compressed for Time: Examining File Compression in Computers
ISEF · 2017
The Paradox of Doing It Wrong in Order to Do It Right
Closest projects by meaning, across every fair and year in the corpus.
Browse more like this
Source: California Science & Engineering Fair public projects