Chapter 6 Revision: Hash Tables
Hash tables achieve near-instantaneous average-case search, insertion, and deletion by transforming keys into array indices through deterministic hash functions. Understanding collision resolution, load factors, and dynamic rehashing is essential to prevent catastrophic degradation.
Use these flashcards for active recall. Try to answer the question out loud before clicking the card to flip it.
Flashcards 🎴
What is the Load Factor (α) of a Hash Table?
n to total bucket capacity m: α = n / m.• In Separate Chaining, α can exceed 1 (represents average chain length).
• In Open Addressing, α cannot exceed 1 (typically rehashed when α ≥ 0.70 to avoid long probe runs).
How do Separate Chaining and Open Addressing resolve collisions?
• Open Addressing: All entries reside directly in the bucket array; collisions probe alternative empty slots (Linear Probing, Quadratic Probing, or Double Hashing).
What is Primary Clustering in Linear Probing?
Why is Tombstone Deletion necessary in Open Addressing?
null would break probe chains, causing future searches for keys inserted past that slot to prematurely terminate and falsely report 'key not found'. Marked tombstone/deleted markers signal to keep searching.What is Dynamic Rehashing and why is it amortized O(1)?