trees :: BinTreeMap :: rotate_left
node
N Y
/ \ > / \
a Y N c
/ \ < / \
b c a b
# Perform left rotation on `node`
#
# ~~~raw
# N Y
# / \ > / \
# a Y N c
# / \ < / \
# b c a b
# ~~~
#
protected fun rotate_left(node: N) do
var y = node.right
node.right = y.left
if y.left != null then
y.left.parent = node
end
y.parent = node.parent
if node.parent == null then
root = y
else if node == node.parent.left then
node.parent.left = y
else
node.parent.right = y
end
y.left = node
node.parent = y
end
lib/trees/bintree.nit:251,2--277,4