December 2023
Intermediate to advanced
504 pages
11h 43m
English
Most programming languages include a data structure called a hash table, and it has an amazing superpower: fast reading. Note that hash tables are called by different names in various programming languages. In Python they’re called dictionaries, and other languages call them hashes, maps, hash maps, dictionaries, or associative arrays. We’ll refer to them as hash tables, since that’s a common universal way to refer to this data structure.
Here’s an example of the menu as implemented with a hash table:
| | menu = { "french fries": 0.75, "hamburger": 2.5, |
| | "hot dog": 1.5, "soda": 0.6 } |
A hash table is a list of paired values. The first item in each pair is called the key, and the second item is called the value. In a hash table, ...
Read now
Unlock full access