StudyGraph
Computer Science Explainer

Load Factor: When a Hash Table Must Grow

Your hash table is fast today. Keep inserting and it quietly slows down.

Lesson notes

Key points

Takeaway: Keep α low by doubling and rehashing; inserts stay amortised O(1).

Quick check: A table has 20 keys in 8 buckets. What is its load factor?
  1. 0.4
  2. 2.5
  3. 160

α = n ÷ m = 20 ÷ 8 = 2.5.

Load factorCost grows with αRehashingAmortised O(1)

Lessons like this, for your syllabus.

Short narrated study videos written for your course, level and exam. Free to start.

Get lessons for your own syllabus