

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Unbalanced Trees
incomplete
2: Red-Black Tree
incomplete
3: Rules
incomplete
4: Rotation
incomplete
5: Fix Insert
incomplete
6: Quiz
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
In addition to all the rules of a Binary Search Tree, a red-black tree must follow some additional ones:
Nil leaf nodes are black.NIL nodes.The re-balancing of a red-black tree does not result in a perfectly balanced tree. It only limits how unbalanced a tree may become. However, its insertion and deletion operations, along with the tree rearrangement and recoloring, are always performed in O(log(n)) time.