A hash table stores data as **key-value pairs** It looks like this ``` hashmap = {} hashmap[2] = 0 hashmap[7] = 1 hashmap[11] = 2 ``` ``` { 2: 0, 7: 1, 11: 2 // key: Value } ``` - feature: insert, search, and delete are all O (1) Constant - python grammer (hash table is **dic** in Python) - `dic` — key-value store - `set` — unordered collection of unique elements, use when we only need to check is element is exist, no need the value - problems - [[Two Sum]] hash table - [[Valid Anagram]] - [[Contains Duplicate]] set ## grammar [[Python Basic Grammar#dict(Hash Table)]]