Handbook
Glossary
sift-down ( heap from to -- )
Vocabulary
heaps
.
private
Inputs
heap
an
object
from
an
object
to
an
object
Outputs
None
Definition
USING:
accessors
kernel
math
;
IN:
heaps.private
::
sift-down
( heap from to -- )
heap
data>>
:>
data to data
data-nth
:>
tmp to
t
[
over
from
>
and
]
[
dup
up
dup
data
data-nth
dup
tmp heap
heap-compare
[
rot
data
data-set-nth
t
]
[
2drop
f
]
if
]
while
tmp
swap
data
data-set-nth
;
inline