← Data Structures & Algorithms learning pathData Structures & Algorithms · Module 6 of 10
Hashing
Look up data in constant time with hash tables.
📖 Key ideas
- Hash tables map keys to values using a hash function.
- Average O(1) insert, search and delete.
- Collisions handled by chaining or open addressing.
- Python dict, Java HashMap, C++ unordered_map.
- Used for counting, deduplication, caching and two-sum.
💡 Real-life example: A hash table is a locker room where a formula turns your name into your locker number.
Hash tableKey-value store using hashing
Hash functionMaps keys to indices
CollisionTwo keys map to the same slot
Load factorFill ratio of the table