Concept Tutorials (14 lessons · 227 topics)
Dedicated visual lessons and interactive labs for core structures, individual sorting algorithms, graphs, and systems. Practice the ideas with connected problems in Practice .
Basic Tier — Arrays, Pointers, Hashing & Sorting Foundations
Arrays, Strings & Pointer Scans
Contiguous memory, dynamic resizing, grids, two/three pointers, sliding windows, and prefix arrays.
Linked Lists, Stacks & Queues
Pointer chains, LIFO/FIFO frontiers, ring buffers, monotonic stacks/deques, and composite stacks.
Bitsets, Hashing, Maps & Sets
Bitwise masks, collision buckets, hash maps/sets, counters, multisets, and O(1) randomized containers.
Recursion, Call Stack & Divide-and-Conquer
Activation frames, base cases, recursive leap of faith, stack-to-loop conversion, and divide-and-conquer recurrence trees.
Sorting Algorithms
Every core sort unpacked individually: Bubble, Selection, Insertion, Gnome, Merge, Heap, Quick, and Timsort.
Bubble Sort & Early-Exit Optimization
Repeatedly swap out-of-order adjacent neighbors to float each pass’s maximum into place — and exit in O(n) the moment a pass makes zero swaps.
Requires: Array
Selection Sort
Scan the unsorted suffix for its global minimum and swap it into place once per pass — guaranteeing at most n - 1 writes.
Requires: Array
Insertion Sort (Iterative & Recursive)
Grow a sorted prefix one card at a time in O(n + inversions) — the fastest sorting algorithm for small and nearly sorted runs.
Requires: Array
Gnome Sort
One cursor, zero nested loops: step forward when ordered, swap and step backward when out of order.
Requires: Insertion Sort
Merge Sort
Split in half down to 1-element base cases, then weave sorted halves back together in linear time for guaranteed Θ(n log n) speed.
Requires: Array, Recursion Frames
Heap Sort
Turn the input array itself into a max-heap in O(n), then repeatedly swap the root maximum into the shrinking tail for O(n log n) in-place sorting.
Requires: Binary Heaps & Top-K
Quick Sort & Quickselect
One partition settles a value. Recursion finishes the rest. Selection keeps only the part it needs.
Requires: Recursion Frames, Three Pointers
Counting Sort
Keep the original cards, derive their end boundaries, and place every record without comparing keys.
Requires: Direct-Address & Freq Array, Prefix Sums
Binary Search, Sweep Line & Intervals
Halving monotonic spaces, lower/upper bounds, coordinate compression, merging intervals, and sweep lines.
Medium Tier — Trees, Heaps, Caches, Sketches & Shortest Paths
Trees, BSTs & Balanced Search Trees
Binary/N-ary trees, BSTs, AVL & Red-Black rotations, Treaps, Skip Lists, Interval Trees, and Binary Lifting.
Heaps, Priority Queues & Streams
Array-backed binary heaps, Top-K gatekeepers, two-heap medians, indexed heaps, and meldable heap forests.
Graphs, Traversal & Union-Find
Adjacency models, implicit grids, BFS/DFS, DAG topological order, Union-Find (DSU), MSTs, and SCCs.
Caching, Eviction & Stampedes
Cache hits/misses, LRU, FIFO, LFU frequency buckets, TTL invalidation, and singleflight stampede control.
Probabilistic Filters & Sketches
Approximate membership, distinct counts, frequency estimates, and similarity signatures with explicit error tradeoffs.
Greedy Algorithms & Essential Math
Greedy choices, interval scheduling, exchange arguments, bit operations, GCD, modular arithmetic, and fast exponentiation.
Advanced Tier — Heuristic Search, Range Trees, Storage & Vector Systems
Shortest Paths & Heuristic Search
Weighted frontier relaxations: Dijkstra, 0-1 BFS, Bellman-Ford, Floyd-Warshall, minimax paths, and A* Search.
Dijkstra’s Shortest Path
How a min-heap explores the cheapest frontier first — and why negative edges break the promise.
Requires: Graph BFS, Binary Heaps & Top-K
A* Search & Heuristic Pathfinding
Give Dijkstra a compass toward the goal — without sacrificing shortest-path optimality.
Requires: Dijkstra’s Algorithm
Backtracking & Dynamic Programming
Call stacks, pruned search trees, memo tables, 1-D/2-D DP, Knapsack, Tree DP, and Bitmask DP.
Tries, String Automata & Range Trees
Tries, Rolling Hash, KMP, Aho-Corasick, Suffix Arrays/Trees, Fenwick Trees, and Lazy/Persistent Segment Trees.
Storage Engines, Vector Search & Distributed CS
B/B+ Trees, WAL, LSM Trees & SSTables, Consistent Hashing, Rate Limiting, Spatial Trees, and HNSW Vector Search.
Streaming Statistics & Quantile Sketches
Heavy hitters, distinct-set estimation, quantiles, relative error, and weighted sampling under bounded memory.
Network Flow, Cuts & Matching
Residual networks, augmenting paths, Dinic, bipartite matching, assignment, and minimum-cost flow.
Computational Geometry
Orientation predicates, segment intersections, polygon queries, convex hulls, closest pairs, and planar diagrams.
Advanced String Algorithms & Compressed Indexes
LCP queries, palindromes, induced suffix sorting, wavelet trees, Burrows-Wheeler transforms, and FM indexes.
Advanced Trees & Offline Queries
Euler tours, LCA, heavy-light and centroid decomposition, rerooting, small-to-large merging, and dynamic forests.
Advanced DP, Convolution & Transforms
Meet-in-the-middle search, conditional DP optimizations, line envelopes, polynomial convolution, FFT, and subset transforms.
Compression & Information Coding
Run-length and delta encoding, Huffman codes, arithmetic coding, and Lempel-Ziv dictionary methods.