Constant time, written O(1), describes work that stays bounded as the number of processed elements grows. Looking up an employee by a directly calculated office number takes the same time for 2, 25, or 250 employees. section 4.1
Hash-based lookup
A dictionary uses a hash function to map a key to a storage location. Retrieving d['a'] hashes 'a' and checks the indicated slot, making the lookup effectively constant time. Collisions—such as two names beginning with S—may require checking several entries. section 4.1






