Hash Tables Flashcards
1
Q
Direct hashing
A
Overwrites data when a collision is found
2
Q
Code for direct hashing
A
3
Q
Separate chaining
A
Each cell of the hash table points to a linked list of records that have the same hash function value
4
Q
Code for separate chaining
A
5
Q
Linear probing
A
Linear probe for the next available index
Formula:
6
Q
Linear probing code
A
7
Q
Quadratic probing
A
When a collision occurs, we iterate with i^2 to look for the next available slot in the table
Formula:
8
Q
Quadratic probing code
A
9
Q
Double hashing
A
When a collision happens, we use another hash function to look for an empty index
Formula:
10
Q
Code for double hashing
A