Compared to other associative array data structures, hash tables are most useful when a large number of records of data are to be stored.
The hash table size is unlimited (or limited only by available storage space). In this case no need to expand the table and recreate a hash function.
Disadvantages
It's difficult (not efficient) to print all elements in hash table.
It's not efficient to find minimum element or maximum element.
The hash table has fixed size. At some point all the elements in the array will be filled. The only alternative at that point is to expand the table, which means modify the hash function to accommodate the increased address space.
Hash table are more difficult and error-prone to write and use.
Hash tables in general exhibit poor locality of reference that is, the data to be accessed is distributed seemingly at random in memory. Because hash tables cause access patterns that jump around, this can be trigger microprocessor cache misses that cause long delays.
References
Augenstein Moshe J., Yedidyah, Langsam, and Aaron Tenenbaum. "Introduction to Data
Structures." Data Structures using C. And C++. United State of America: Prentice-Hall, Inc., 1996.22-24.
Carlson, David. "Hash Tables." Saint Vincent College. 2004. Saint Vincent College. 6 July 2005 http://cis.stvincent.edu/swd/hash/hash.html.
Our semester plans gives you unlimited, unrestricted access to our entire library of resources —writing tools, guides, example essays, tutorials, class notes, and more.
Get Started Now