1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
left_rotate(T, root) rChild = root.right root.right = rChild.left if rChild.left != T.null rChild.left.parent = root rChild.parent = root.parent if root.parent == T.null T.root = rChild elif root == root.parent.left root.parent.left = rChild else root.parent.right = rChild rChild.left = root root.parent = rChild
|
近期评论