deterministic must be there

This commit is contained in:
Jidong Xiao
2025-03-31 20:05:24 -04:00
committed by JamesFlare
parent 92a4145c43
commit 7a7c44ed25

View File

@@ -152,6 +152,7 @@ std::string identify(Node* phonebook[PHONEBOOK_SIZE], int number) {
## 22.9 What makes a Good Hash Function? ## 22.9 What makes a Good Hash Function?
- Deterministic same input always produces the same hash.
- Goals: fast O(1) computation and a random, uniform distribution of keys throughout the table, - Goals: fast O(1) computation and a random, uniform distribution of keys throughout the table,
despite the actual distribution of keys that are to be stored. despite the actual distribution of keys that are to be stored.
- For example, using: f(k) = abs(k)%N as our hash function satisfies the first requirement, but may not - For example, using: f(k) = abs(k)%N as our hash function satisfies the first requirement, but may not