Hash Table data structures explained

Hashing is a technique used to search an specific item in large group of items. Hashing uses hash table to perform search in an constant O(1) time. Hashing uses hash functions to fill items in a hash table. To search, each key is passed into the same hash function which computes an index which provides the corresponding value location.

A Hash table data structures are used in hashing which stores all the key value pairs.

Let’s have a look at the ideal hash table.

Ideal Hash Table
Ideal Hash Table

Hashing Methodology

Hashing method has following key constituents.

Hash Table

A Hash table in Hashing is the data structure which stores all the key value pairs. Hash functions are used to insert values in the hash table. A good hash table must have uniformly distributed values.

Hash Function

A Hash function in Hashing is a function which converts the input data arbitrary range to a fixed range defined by the Hash Table. The value computed by the hash function is called the hashes or hash values of key “K”.
Example:

  • Modulo (%) of key with Hash table size.
  • Last 5 digits of a mobile number.

Let’s have a look into some of the most popular and useful topics in Hash table data structures.

Leave a Reply

Your email address will not be published. Required fields are marked *