Python Arena

Module 61 Extra

Hash tables

Build the data structure behind dict and set. Buckets and chaining, a load factor that makes the table grow, a map that works with square brackets, in, len and for like a dict, __eq__ and __hash__ for keys of your own, and an LRU cache with OrderedDict and functools.lru_cache.

Steps

  1. Buckets and chaining
  2. Load factor and rehashing
  3. A map that works like dict
  4. Hashing your own keys
  5. Challenge: an LRU cache