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.
Lessons and interactive exercises
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.
Explore the new university courses in French.
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.
Lessons and interactive exercises
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.
Lessons and interactive exercises
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).
Lessons and interactive exercises
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.
Lessons and interactive exercises
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.
Lessons and interactive exercises
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.
Lessons and interactive exercises