The previous lesson stated the red-black properties and claimed that rotations restore them cheaply after any mutation, without showing the mechanism. This derivation works through the case analysis for insertion fix-up in full (deletion fix-up is structurally similar but longer; it is summarised at the level CLRS itself uses for a second pass) and shows why the case analysis terminates in rotations — in fact at most actual rotations, with colour flips.
In this lesson
- Insertion: where the violation can occur
- Why this terminates and costs
- Deletion fix-up, at a glance
Before you start
The full lesson, with worked examples and exercise solutions, is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or explore the curriculum.