Hash Map

Domain: Data Structures

🎯 Motivation

When you need to look up values by key instantly — phone numbers by name, scores by student — a hash map provides O(1) access.

📋 Concrete Example

phone = {'Alice': '555-1234', 'Bob': '555-5678'}. phone['Alice'] returns the number immediately, no matter how many entries exist.

🔗 Analogy

A cloakroom with numbered hooks. You give your coat, the attendant puts it on hook 42 (the hash of your ticket), and when you return they go straight to hook 42.