Изменения

Перейти к: навигация, поиск

Левосторонние красно-чёрные деревья

12 байт добавлено, 02:48, 8 декабря 2017
Удаление
<code>
'''Node''' deleteMin( h : '''Node'''):
'''if''' h.left == ''null'' '''return''''' null''
'''if''' !isRed(h.left) '''&&''' !isRed(h.left.left)
h = moveRedLeft(h)
<code>
'''Node’’’ Node''' moveRedRight(h :'''Node''' ):
colorFlip(h)
'''if''' isRed(h.left.left))
h = rotateRight(h)
'''if''' key.compareTo(h.key) == 0 '''&&''' (h.right == null)
'''return''''' null'' '''if''' !isRed(h.right) '''&& ''' !isRed(h.right.left)
h = moveRedRight(h)
'''if''' key.compareTo(h.key) == 0
288
правок

Навигация