Data structure

Hash Table

Hash Table

A hash table is a data structure that maps keys to values. A hash table uses hash function to compute the index. From this index desired value can be found. 

Hash function assigns each key to a unique bucket. In some cases, hash function gives the same index for more than one key. 

Hashing: Hashing is to distribute the entries across the array. A key is used to compute the index.

Hash Table uses an array as a storage medium and uses hash technique to generate an index where an element is to be inserted or is to be located from.


Hash Function

 

 

Basic Operations in hash table:

Following are the basic primary operations of a hash table.

  • Search − Searches an element in a hash table.
  • Insert − inserts an element in a hash table.
  • delete − Deletes an element from a hash table.

Basic Operations in hash table:

Following are the basic primary operations of a hash table.

  • Search − Searches an element in a hash table.
  • Insert − inserts an element in a hash table.