Learn
Each page explains one topic with a step-by-step example, common pitfalls and complexity. The button at the bottom opens the matching interactive exercise.
Red-black trees
The properties of a red-black tree, rotations, the 3 insertion cases and the 4 deletion rules (double black), with worked examples and common pitfalls.
Binary search trees
How to insert and delete in a BST (leaf, one child, two children), preorder, in-order and postorder traversals, successor, predecessor and finding the k-th smallest element.
Heaps
How a binary heap stored in an array works: parent and child indices, insertion with sift-up, ExtractMin with sift-down, and why Build heap runs in O(n).
Sorting
How insertion sort, selection sort, merge sort, quicksort (Lomuto partition) and heapsort work, with an example for each, their complexity, stability and when to use them.
Minimax and Alpha-Beta
How the minimax algorithm picks the best move in a two-player game, and how alpha-beta pruning cuts useless branches using the α and β bounds.
Graphs
Depth-first search (DFS) and breadth-first search (BFS), shortest paths with Dijkstra, and A* heuristic search with f(n) = g(n) + h(n), with complete worked examples.