Hash Tables Flashcards
1
Q
Define Hash Table
A
data structure that implements an associative array (dictionary)
2
Q
Define Hash Function
A
algorithm that converts a hash key to a hash value
3
Q
What must a hash function have
A
- always produce the same hash value for the same key
- provide a uniform distribution of hash values
- minimise clustering
- fast to compute
4
Q
Define collision (hash table)
A
occurs when the hash function produces the same hash value for two or more keys
5
Q
Define linear probing
A
a solution to handling collisions, can probe sequentially or using an interval until an empty space is found
6
Q
Define chaining
A
a solution to handling collisions, using linked lists by storing the pointer to where the data is stored