Skip to main content

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

Basic Tier — Arrays, Pointers, Hashing & Sorting Foundations

Arrays, Strings & Pointer Scans

Contiguous memory, dynamic resizing, grids, two/three pointers, sliding windows, and prefix arrays.

View Scope Graph (11) →

Recursion, Call Stack & Divide-and-Conquer

Activation frames, base cases, recursive leap of faith, stack-to-loop conversion, and divide-and-conquer recurrence trees.

View Scope Graph (5) →

Sorting Algorithms

Every core sort unpacked individually: Bubble, Selection, Insertion, Gnome, Merge, Heap, Quick, and Timsort.

View Scope Graph (10) →
Lesson + interactive lab 10 min

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

O(n²) worst · O(n) best · O(1) space · Stable Open →
Lesson + interactive lab 10 min

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

O(n²) always · ≤ n−1 swaps · Unstable Open →
Lesson + interactive lab 12 min

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

O(n) best · O(n²) worst · O(1) space · Stable Open →
Lesson + interactive lab 9 min

Gnome Sort

One cursor, zero nested loops: step forward when ordered, swap and step backward when out of order.

Requires: Insertion Sort

O(n) best · O(n²) worst · 1 cursor · Stable Open →
Lesson + interactive lab 14 min

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

O(n log n) guaranteed · O(n) space · Stable Open →
Lesson + interactive lab 13 min

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

O(n log n) worst-case · O(1) auxiliary space Open →
Lesson + interactive lab 15 min

Quick Sort & Quickselect

One partition settles a value. Recursion finishes the rest. Selection keeps only the part it needs.

Requires: Recursion Frames, Three Pointers

O(n log n) with balanced splits · O(n²) time and O(n) stack worst case Open →
Lesson + interactive lab 12 min

Counting Sort

Keep the original cards, derive their end boundaries, and place every record without comparing keys.

Requires: Direct-Address & Freq Array, Prefix Sums

O(n + K) time & space · Stable Open →
Roadmap topics (2): Timsort Radix Sort

Binary Search, Sweep Line & Intervals

Halving monotonic spaces, lower/upper bounds, coordinate compression, merging intervals, and sweep lines.

View Scope Graph (7) →
Medium

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.

View Scope Graph (14) →

Graphs, Traversal & Union-Find

Adjacency models, implicit grids, BFS/DFS, DAG topological order, Union-Find (DSU), MSTs, and SCCs.

View Scope Graph (12) →

Greedy Algorithms & Essential Math

Greedy choices, interval scheduling, exchange arguments, bit operations, GCD, modular arithmetic, and fast exponentiation.

View Scope Graph (10) →
Advanced

Advanced Tier — Heuristic Search, Range Trees, Storage & Vector Systems

Backtracking & Dynamic Programming

Call stacks, pruned search trees, memo tables, 1-D/2-D DP, Knapsack, Tree DP, and Bitmask DP.

View Scope Graph (8) →

Streaming Statistics & Quantile Sketches

Heavy hitters, distinct-set estimation, quantiles, relative error, and weighted sampling under bounded memory.

View Scope Graph (12) →

Network Flow, Cuts & Matching

Residual networks, augmenting paths, Dinic, bipartite matching, assignment, and minimum-cost flow.

View Scope Graph (9) →

Computational Geometry

Orientation predicates, segment intersections, polygon queries, convex hulls, closest pairs, and planar diagrams.

View Scope Graph (10) →

Advanced String Algorithms & Compressed Indexes

LCP queries, palindromes, induced suffix sorting, wavelet trees, Burrows-Wheeler transforms, and FM indexes.

View Scope Graph (8) →

Advanced Trees & Offline Queries

Euler tours, LCA, heavy-light and centroid decomposition, rerooting, small-to-large merging, and dynamic forests.

View Scope Graph (10) →

Advanced DP, Convolution & Transforms

Meet-in-the-middle search, conditional DP optimizations, line envelopes, polynomial convolution, FFT, and subset transforms.

View Scope Graph (9) →

Compression & Information Coding

Run-length and delta encoding, Huffman codes, arithmetic coding, and Lempel-Ziv dictionary methods.

View Scope Graph (6) →