Latest article
Data Structures
Trie
How a trie, or prefix tree, stores keys as paths of characters: insert, search and startsWith in O(k), deletion, memory per node and radix trees in Go.
Written by Eduardo Schelive, software engineer
Long-form guides with interactive playgrounds you can run, step through and break, so the idea sticks and not just the syntax.
Latest article
Data Structures
How a trie, or prefix tree, stores keys as paths of characters: insert, search and startsWith in O(k), deletion, memory per node and radix trees in Go.
Series
Each series builds on the article before it, from the cost of an operation to the structures and the language that use it.
How arrays, linked lists, trees, graphs and hash tables organize data in memory, what each operation costs, and when to pick one structure over another.
The ideas every other series builds on. Learn how to reason about cost, growth and scalability before choosing a data structure or an algorithm.
Go from scratch: basic types and control flow, functions, interfaces, error handling, packages and modules, then goroutines, channels and concurrency.
Journal
Data Structures · Part 3
Why Go makes you declare an array's size and JavaScript doesn't. Compare memory footprints with Uint32Array and see what JavaScript trades for convenience.
Fundamentals · Part 1
How Big O describes the way an algorithm's cost grows with its input: time and space complexity, the worst case, and the common classes from O(1) to O(n!).
Data Structures · Part 14
How graphs model relationships between nodes, from directed, weighted and cyclic graphs to how adjacency lists and matrices trade space for lookup speed in Go.
Data Structures · Part 12
A heap answers "what is the smallest right now" with a weak invariant. The Priority Queue ADT, sifting up and down, the array layout and an O(n) build-heap.
Data Structures · Part 11
How rotations put a floor under a binary search tree, with the balance factor, AVL's four cases, why libraries chose red-black, and what balancing costs.
Data Structures · Part 10
How one ordering rule turns a binary tree into a search structure: the recursive invariant, search, insert, the three delete cases, and why sorted input hurts.
Data Structures · Part 9
What the two-child limit gives you: full, complete, perfect, balanced and degenerate shapes, why height sets the cost, and how a binary tree fits in an array.
Data Structures · Part 8
How trees organize data with one parent per node: root, depth and height, why V nodes always have V-1 edges, and how Go represents children in memory.