1
правка
Изменения
м
if grandfather.left != ''nil'' uncle = grandfather.left; if uncle.colour == red <font color=green>// случай, когда "дядя" красный </font> t.parent.colour = black uncle.colour = black grandfather.colour = red t = grandfather '''else''' '''if''' t.parent.left == t t = t.parent rightRotate(t) t.parent.colour = black grandfather.colour = red leftRotate(grandfather)
фикс табуляции
grandfather.colour = red
rightRotate(g)
'''else'''
'''if''' grandfather.left != ''nil''
uncle = grandfather.left;
'''if''' uncle.colour == red
<font color=green>// случай, когда "дядя" красный </font>
t.parent.colour = black
uncle.colour = black
grandfather.colour = red
t = grandfather
'''else'''
root.colour = black <font color=green>// восстанавливаем свойство корня </font>