/Dict

Hashing

- Sam Rose tl;dr: “In this post, we're going to demystify hash functions. We're going to start by looking at a simple hash function, then we're going to learn how to test if a hash function is good or not, and then we're going to look at a real-world use of hash functions: the hash map.”

featured in #425


The World's Smallest Hash Table

- Orson Peters tl;dr: Orson tackles an Advent of Code, which he optimizes “completely beyond the point of reason” but also contains a useful technique, showing us how to store a small lookup table with small elements as a constant, indexed using shifts.

featured in #395


Don't Let Dicts Spoil Your Code

- Roman Imankulov tl;dr: "The simplicity of organic code growth has a flip side: it becomes too hard to maintain. The proliferation of dicts as primary data structures is a clear signal of tech debt in your code. Fortunately, modern Python provides many viable alternatives to plain dicts."

featured in #329


Quadratic Algorithms Are Slow (And Hashmaps Are Fast)

- Julia Evans tl;dr: Julia guides us through what a quadratic time function looks like, why it's slow, how to convert a quadratic algorithm into a linear one using a hashmap.

featured in #252


Hashing it Out

- Akshay Ravikumar tl;dr: Akshay runs through 4 advanced Python dictionary questions and solutions he presented students at MIT.

featured in #193


A Simple GPU Hash Table

- David Farrell tl;dr: "Capable of hundreds of millions of insertions per second. Code inserts 64 million randomly generated key/values in about 210 milliseconds, and deletes 32 million of those key/value pairs in about 64 milliseconds."

featured in #176


Dicts Are Now Ordered, Get Used To It

- Ivan Sagalaev tl;dr: "Changed in version 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6."

featured in #172