Binary search trees to AVL and red-black trees
12 steps · about 5 h 45 min · Intermediate
- Binary search tree (reference, Wikipedia, 15 min)
Start with the core definition, the operations, and the reason worst-case performance depends on insertion order.
- A Quick Guide to Binary Search Trees (article, Baeldung, 15 min)
A concise walkthrough of the BST property and insertion pseudocode before you look at code.
- Binary Search Tree(BST) (tutorial, Programiz, 25 min)
Runnable insert, search and delete code in several languages lets you implement a BST yourself.
- CMSC 420: Binary Search Trees (doc, University of Maryland (J. Wyss-Gallifent), 30 min)
Covers the tricky deletion cases and the Θ(n) worst case that motivates balancing.
- Binary Search Tree, AVL Tree - VisuAlgo (interactive, VisuAlgo, 25 min)
Try BST operations and see AVL height and balance-factor updates in one tool.
- Lecture 6: Balanced Binary Search Trees (doc, MIT OpenCourseWare 6.006, 30 min)
The authoritative AVL treatment: height invariants, rotations and how insert rebalances going up the tree.
- AVL Tree Visualization (interactive, avlvisualizer.com, 25 min)
Practise the four LL, RR, LR and RL rotation cases, including inserting sorted input.
- Lecture 11: Balanced BSTs. Red-Black Trees (article, Cornell CS312, 25 min)
A gentle introduction to the red-black rules and why the longest path is at most twice the shortest.
- Lecture 10: Red-black Trees, Rotations, Insertions, Deletions (video, MIT OpenCourseWare (Leiserson, Demaine), 1 h 20 min)
The full lecture on red-black properties, the link to 2-3-4 trees and how insertion works.
- Red-Black Tree Visualization (interactive, VizLearn, 25 min)
Watch insertions play out as recolor and rotate steps, so you can check your hand traces.
- COMP251: Red-black trees (doc, McGill University, 30 min)
Lays out the uncle-based insertion cases to practise and compares red-black trees with AVL.
- Red-Black Tree vs. AVL Tree (article, Baeldung, 20 min)
Finish by comparing the two trees so you can say when to pick each.