VIVID CODE / ARTICLES
63 articles
SimHash: A Whole Document in 64 Bits
A practical explanation of how SimHash combines weighted feature hashes into a compact 64-bit fingerprint and uses Hamming distance to estimate document similarity.
Read articleHash Table: Why Resize at Three-Quarters Full?
Compute a slot from the key; chain or probe on a collision; and why a table that fills past about three-quarters must double.
Read articleCuckoo Hashing: Two Homes per Key, and Whoever Is There Gets Kicked Out
A practical guide to cuckoo hashing: every key has two candidate slots, insertion may evict occupants and move them to their alternate homes, lookup checks at most two locations, and a cycle triggers a rebuild. The two four-slot-table model makes the kick chain, bounded lookup, load factor, and rehashing behavior concrete.
Read articleHopscotch Hashing: Make the Free Slot Hop Back
A practical guide to how Hopscotch hashing uses fixed neighborhoods, bitmaps, and hopping relocations to keep open-addressed lookups stable.
Read articleRobin Hood Hashing: Let the Farthest Key Sit First
A practical explanation of how Robin Hood hashing uses probe distance, displacement swaps, and early termination to make open-addressed hash-table lookups more predictable.
Read articleCartesian Trees: One Array, Two Structural Properties, and Linear-Time Construction
A practical guide to Cartesian trees using [3, 2, 5, 1, 4]. Learn their in-order and min-heap invariants, why direct construction can take O(n²), how a monotonic stack builds the same tree in O(n), how range minima correspond to lowest common ancestors, and why a Treap is a Cartesian tree with random priorities.
Read articleMerkle Tree: One Hash Vouches for All the Data
A practical explanation of how Merkle trees summarize data, locate differences between replicas, and prove block membership with only logarithmically many sibling hashes.
Read articleInterval Tree: Every Clashing Event, Found at Once
A practical explanation of interval trees using a five-meeting calendar. The tree is ordered by interval starts, while each node stores the latest end in its subtree so searches can prune entire regions that cannot overlap a point or interval.
Read articleAVL Trees: Detecting Imbalance and Choosing the Right Rotation
A practical guide to AVL balance factors, the LL, RR, LR, and RL cases, and restoring balance after deletion.
Read articleBinary Search Tree: Smaller Left, Larger Right — Until It Becomes a List
Animates search, insert and delete in a binary search tree: smaller-left, larger-right means each search walks one path, O(log n) on average — until sorted inserts turn the tree into a list and search becomes O(n).
Read articleFenwick Tree: Every Rank From One Array
Learn how a Fenwick tree turns leaderboard scores into fast prefix queries and point updates by using lowbit-defined ranges.
Read articleSkip List: Expected O(log n) Search from a Linked List
An animated explanation of how skip lists add sparse index lanes to sorted linked lists, enabling expected O(log n) search, insertion, and deletion.
Read article