Handbook
Glossary
avl-insert ( value key node -- node taller? created? )
Vocabulary
trees
.
avl
.
private
Inputs
value
an
object
key
an
object
node
an
object
Outputs
node
an
object
taller?
an
object
created?
an
object
Definition
USING:
accessors
kernel
math.order
namespaces
trees.private
;
IN:
trees.avl.private
:
avl-insert
( value key node -- node taller? created? )
2dup
key>>
before?
left
right
?
[
[
node-link
avl-set
]
keep
-rot
[
[
set-node-link
]
keep
]
2dip
swap
[
[
current-side
get
increase-balance
balance-insert
]
dip
]
[
f
swap
]
if
]
with-side
;