Binary search trees to AVL and red-black trees

12 steps · about 5 h 45 min · Intermediate

  1. Binary search tree (reference, Wikipedia, 15 min)

    Start with the core definition, the operations, and the reason worst-case performance depends on insertion order.

  2. 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.

  3. Binary Search Tree(BST) (tutorial, Programiz, 25 min)

    Runnable insert, search and delete code in several languages lets you implement a BST yourself.

  4. 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.

  5. Binary Search Tree, AVL Tree - VisuAlgo (interactive, VisuAlgo, 25 min)

    Try BST operations and see AVL height and balance-factor updates in one tool.

  6. 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.

  7. AVL Tree Visualization (interactive, avlvisualizer.com, 25 min)

    Practise the four LL, RR, LR and RL rotation cases, including inserting sorted input.

  8. 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.

  9. 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.

  10. Red-Black Tree Visualization (interactive, VizLearn, 25 min)

    Watch insertions play out as recolor and rotate steps, so you can check your hand traces.

  11. 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.

  12. Red-Black Tree vs. AVL Tree (article, Baeldung, 20 min)

    Finish by comparing the two trees so you can say when to pick each.