Algorithms & DP

Algorithms & DP

Algorithms & Dynamic Programming — animated visualizations, DP tables, recursion trees, complexity walkthroughs.

804Articles
804Topics covered
Articles in this category

All 34 articles, sorted alphabetically

Advertisement
ARTICLE · 01

ARC architecture

Deep-dive on ARC, the Adaptive Replacement Cache that beats LRU and LFU by adapting the recency-versus-frequency balance automatically per workload, w…

Read article
ARTICLE · 02

Big-O Notation

How Big-O notation describes worst-case time and space complexity, why constants and lower-order terms drop, and how to reason about scalability.

Read article
ARTICLE · 03

Bloom filter architecture

Deep-dive on Bloom filter architecture: hash family, sizing math, counting and cuckoo variants, and the ops layer for production use.

Read article
ARTICLE · 04

Count-Min Sketch Architecture in Depth

A 2500-word walkthrough of Count-Min Sketch: d × w counter matrix, hash functions, insert + query, overestimate math, parameters, applications, varian…

Read article
ARTICLE · 05

Consistent hashing architecture

Deep-dive on consistent hashing: ring, virtual nodes, replica walk, bounded loads, Anchor/Jump/Rendezvous variants, and cluster management.

Read article
ARTICLE · 06

Cuckoo Filter

Cuckoo filter: modern Bloom alternative.

Read article
ARTICLE · 07

DiskANN architecture

Deep-dive on DiskANN: the Vamana low-diameter graph, product-quantized guidance in RAM with full vectors on disk, beam search and exact re-rank, alpha…

Read article
ARTICLE · 08

Distributed Consensus Architecture: Raft, Paxos, and Beyond

A 2500-word walkthrough of a modern consensus system: client, coordinator, leader, log, followers, state machines, and snapshots.

Read article
ARTICLE · 09

Fenwick Tree (BIT)

How Fenwick trees (Binary Indexed Trees) enable O(log n) point updates and prefix sum queries with less overhead than segment trees.

Read article
ARTICLE · 10

Hash Tables

How hash tables provide O(1) average lookup, collision resolution strategies (chaining, open addressing), and load factor tuning.

Read article
ARTICLE · 11

Heap Operations

How binary heaps implement priority queues in O(log n), the heapify trick, and applications from Dijkstra to scheduling.

Read article
ARTICLE · 12

HyperLogLog Algorithm Architecture in Depth

A 2500-word walkthrough of HyperLogLog: hash function, bucketing, rank via leading zeros, harmonic mean estimator, bias correction, merge, space-error…

Read article
ARTICLE · 13

HNSW architecture

Deep-dive on HNSW: layered proximity graphs, greedy descent and efSearch beam search, geometric level assignment, the diversity neighbor heuristic, fi…

Read article
ARTICLE · 14

IVF-PQ vector index architecture

Deep-dive on the IVF-PQ approximate nearest-neighbor index: coarse quantization and inverted lists (nlist/nprobe), product quantization into per-subsp…

Read article
ARTICLE · 15

KMP Algorithm

How the Knuth-Morris-Pratt algorithm finds a pattern in text in O(n+m) by precomputing a failure function.

Read article
ARTICLE · 16

LRU cache architecture

Deep-dive on LRU cache: hash map + linked list, admission policies (TinyLFU), concurrency, TTL, weighted entries, variants.

Read article
ARTICLE · 17

LSM Tree Compaction Architecture in Depth

A 2500-word walkthrough of LSM compaction: memtable → SSTables, STCS/LCS/TWCS strategies, triggers, throttling, and read/write/space amplification.

Read article
ARTICLE · 18

LSM trees vs B-trees

Deep-dive on LSM trees vs B-trees: in-place read-optimized B-trees vs append-merge write-optimized LSM trees, write/read/space amplification, compacti…

Read article
ARTICLE · 19

Mergesort

How mergesort divides, sorts, and merges. Why it's stable, why it's the choice for linked lists, and how it …

Read article
ARTICLE · 20

Merkle trees -- efficient verification of large data

Deep-dive on Merkle trees: hashing data blocks into leaves and up to a single root, tamper evidence (any change alters the root), O(1) root comparison…

Read article
ARTICLE · 21

Quicksort

How quicksort partitions around a pivot and recursively sorts, why it's O(n log n) average, and how to avoid O(n²) worst case.

Read article
ARTICLE · 22

Quotient Filter

Quotient filter: cache-friendly approximate set.

Read article
ARTICLE · 23

Reservoir Sampling

Reservoir sampling for streaming uniform samples.

Read article
ARTICLE · 24

Ribbon filter architecture

Deep-dive on the ribbon filter: a static approximate-membership structure that encodes the key set as a solved banded linear system over GF(2), reachi…

Read article
ARTICLE · 25

Roaring bitmaps -- compressed bitmaps that stay fast

Deep-dive on roaring bitmaps: the bitmap dilemma (fast but big, or small but slow), chunking the integer space by the high 16 bits, the three adaptive…

Read article
ARTICLE · 26

Segment Tree

How segment trees enable range sum, min, max queries in O(log n), and how lazy propagation supports range updates.

Read article
ARTICLE · 27

Skip list architecture

Deep-dive on skip lists: levels, level selection, search, insert/delete, concurrent variants, range iterators, memory, use cases.

Read article
ARTICLE · 28

Space-Saving architecture

Deep-dive on the Space-Saving algorithm for approximate top-k heavy hitters: a fixed table of k counters, the increment-or-evict-the-minimum rule that…

Read article
ARTICLE · 29

t-digest architecture

Deep-dive on the t-digest quantile sketch: (mean, count) centroids, the scale function that warps cluster sizes to keep the tails sharp, the compressi…

Read article
ARTICLE · 30

Top-K / heavy hitters -- finding the most frequent in a stream

Deep-dive on top-K / heavy-hitter algorithms: the most-frequent-items problem, why exact counting is memory-prohibitive, Space-Saving (bounded counter…

Read article
ARTICLE · 31

Longest Palindromic Subsequence

Longest subsequence (not contiguous) that's a palindrome. O(N²) DP.

Read article
ARTICLE · 32

Planarity Testing

Determine if graph can be drawn without edge crossings. O(V+E).

Read article
ARTICLE · 33

Traveling Salesman Problem

Bitmask DP: O(2^N × N²) beats brute-force O(N!).

Read article
ARTICLE · 34

Word Search

Find word in 2D grid by adjacency. Classic DFS + backtracking.

Read article