Constant time, written O(1), describes work whose execution time does not grow as the input grows. A direct lookup can take the same amount of time whether the collection has 2, 25, or 250 items. section 5.1
Direct lookup and collisions
An office numbered for each initial sends visitors directly to the relevant location. Python dicts use a similar idea: a key passes through a hash function, which identifies where its key–value pair is stored. Retrieving d['a'] hashes 'a' and checks the indicated slot. Collisions require additional handling, such as sharing a location and searching within it. section 5.1






