Leaf 1: 4 5 7
Leaf 2: 15 16 19 23
Leaf 3: 24 25 27
Leaf 4: 29 34 36 43
Leaf 5: 61 72 98
Node 1: (parent of Leaf 1 and Leaf 2)
keys: 15
Node 2: (parent of Leaf 3, Leaf 4, and Leaf 5)
keys: 29 61
Node 3: (root and parent of Node 1 and Node 2)
keys: 24
A red-black tree is a binary search tree with the following red-black properties:
i: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
a: 1 20 2 39 21 78 58 40 77 59
root : 15
children of 15: 19 16
children of 19: 27 23
children of 16: 24
children of 27: 61
children of 23: 34
children of 24: 29
Bo: root : 6
B3: root : 27
children of 27: 24 7 19
children of 7: 5
children of 24: 23 15
children of 23: 4
After Pass 1 After Pass 2
1792 8710 4205
4865 2190 8710
2412 1792 2412
2456 2412 2412
8710 2412 1453
2412 1453 2456
4567 4865 4865
1297 4205 4567
1453 2456 2190
2190 4567 1792
4205 1297 1297
pivot = 41
i: 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
a: 19 29 39 25 28 41 91 95 63 46 43 57 77 63 72 63 69 48 86