August 2024
Intermediate to advanced
516 pages
11h 47m
English
On nights and weekends, you’re single-handedly working on a stealth startup that will take over the world. It’s…a thesaurus app. But this isn’t any old thesaurus app—this is Quickasaurus. And you know that it will totally disrupt the billion-dollar thesaurus market. When a user looks up a word in Quickasaurus, it returns just one synonym, instead of every possible synonym, as old-fashioned thesaurus apps do.
Since every word has an associated synonym, this is a great use case for a hash table. After all, a hash table is a list of paired items. Let’s get started.
We can represent our thesaurus using a hash table:
| | thesaurus = {}; |
Under the hood, a hash table stores its data in a bunch ...
Read now
Unlock full access