How dictionaries really work
This rather long post looks like a discussion for dissertation because I encountered a problem, found a solution, and want to share it with my users. Therefore, this post is my attempt to explain to novice programmers how hash tables work.A hash table is a data structure for storing key-value pairs and is part of the standard library of many languages. Depending on your language of choice, you might know hash tables as hashes, HashMaps, dictionaries, dicts, associative arrays, or symbol tables.
If you're already familiar with hash tables, you'll probably spot many points in this post where I have either simplified things, or avoided talking about them entirely. If you think that any of these simplifications hinder rather than help ...more ...