Handbook
Glossary
long-lived-tree ( max-depth -- )
Vocabulary
benchmark
.
binary-trees
Inputs
max-depth
an
object
Outputs
None
Definition
USING:
io
kernel
math
math.parser
ranges
sequences
;
IN:
benchmark.binary-trees
::
long-lived-tree
( max-depth -- )
0 max-depth
bottom-up-tree
min-depth
max-depth 2
<range>
[|
depth |
max-depth depth
-
min-depth
+
2^
[
[1..b]
0
[
dup
neg
[
depth
bottom-up-tree
item-check
+
]
bi@
]
reduce
]
[
2
*
number>string
write
]
bi
"\t trees of depth "
write
depth
number>string
write
"\t check: "
write
number>string
print
]
each
"long lived tree of depth "
write
max-depth
number>string
write
"\t check: "
write
item-check
number>string
print
;
inline