Skip to main content

VIVID CODE / ARTICLES

63 articles

AlgorithmsOct 7, 2026

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.

SimHashSimilarityHamming distanceDocument fingerprintsHashingRead article
Data StructuresOct 6, 2026

Hash 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.

hash tableshashingalgorithmshash mapshash setscollision resolutionload factorRead article
Data StructuresOct 6, 2026

Cuckoo 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.

hashingcuckoo hashinghash tablescollision resolutionhash mapshash setsdata structuresRead article
Data StructuresOct 2, 2026

Hopscotch 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.

hashinghash tableshopscotch hashingRead article
Data StructuresOct 2, 2026

Robin 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.

hashinghash tablesRobin Hood hashingopen addressinglinear probingalgorithmsRead article
Data StructuresSep 26, 2026

Cartesian 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.

Cartesian TreeRange Minimum QueryMonotonic StackTree AlgorithmsTreapRead article
Data StructuresSep 25, 2026

Merkle 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.

Merkle treeHashingDistributed systemsReplica reconciliationBitcoin light walletsRead article
Data StructuresSep 25, 2026

Interval 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.

interval treestree algorithmsrange queriesbinary search treescalendar algorithmsRead article
Data Structures and AlgorithmsSep 23, 2026

AVL 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.

AVL TreeRotationsTree BalancingRead article
Data StructuresSep 23, 2026

Binary 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).

binary search treetree algorithmscomplexityRead article
Data StructuresSep 22, 2026

Fenwick 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.

Fenwick TreeBinary Indexed TreePrefix SumsRead article
Data StructuresSep 22, 2026

Skip 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.

skip listslinked listsalgorithmsrandomized data structuressearch algorithmsRead article