August 2024
Intermediate to advanced
516 pages
11h 47m
English
When we look up items from a hash table, we use a key to find its associated value. Let’s see how this works with our Quickasaurus example hash table.
Suppose we want to look up the value associated with the key "bad". In our code, we’d say this:
| | thesaurus["bad"] |
To find the value associated with "bad", the computer executes two simple steps:
Let’s take a step back and look at the big picture here. In a hash table, the placement of each value is determined by its key; that is, by hashing the key itself, we compute the index number ...
Read now
Unlock full access