what is a hash table ?
It is also known as a hash map, a data structure used to implement an associative array. This is a structure that can map keys to values.
How it works?
The hash table uses a hash function to calculate the index into an array of buckets or slots from which to find the correct value.
See the diagram below for a clear explanation.

<strong> Benefits:
In a well-distributed hash table, the average cost of each search is independent of the number of items stored in the table.
Many hash table schemes also allow arbitrary insertion and deletion of key-value pairs.
In many situations, hash tables are more efficient than search trees or any other table search structure.
Disadvantages:
Hash tables are invalid when the number of records is very small. (However, in some cases, the high cost of computing a hash function can be reduced by storing the hash value with the key.)
Application:
They are widely used in many types of computer software, especially for associative arrays, indexing databases, caches, and collections.
Durai Amuthan.H Aug 24 '13 at 10:21 2013-08-24 10:21
source share