288
правок
Изменения
→Удаление
<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