In computing, a hash table, also known as hash map or dictionary, is a Data structure that implements a [Associative array], 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.

Ideally, the hash function will assign each key to a unique bucket, but most hash table designs employ an imperfect hash function, which might cause hash collisions where the hash function generates the same index for more than one key. Such collisions are typically accommodated in some way.

(“Hash Table” 2022)

References


Links to this note