trees :: BinTreeMap :: shift_down
node
in tree from a specified from
index
# Push down the `node` in tree from a specified `from` index
protected fun shift_down(from, node: N) do
var cmp = node.key <=> from.key
if cmp < 0 then
if from.left == null then
from.left = node
node.parent = from
else
shift_down(from.left.as(not null), node)
end
else if cmp > 0 then
if from.right == null then
from.right = node
node.parent = from
else
shift_down(from.right.as(not null), node)
end
end
end
lib/trees/bintree.nit:174,2--192,4