reading-notes

View on GitHub

Hash Tables

OverView

Hash Table is a data structure that implements an associative array abstract data type, a structure that can map keys to values. A hash table uses a hash function to compute an index, also called a hash code, into an array of buckets or slots, from which the desired value can be found. During lookup, the key is hashed and the resulting hash indicates where the corresponding value is stored.

Terminology

A hash table has the following terminology:

Structure

adding and getting values from the hash table is done using an index that has been evaluated using the hash, so the time complexity to add and to get data from the hash table is O(1)

Why do we use a Hash Table