On Mon, 29 Nov 1999 [EMAIL PROTECTED] wrote:
> Gisle,
>
> What do you think of the following example? I expect the 100000 could be
> increased significantly, but I get tired of waiting.
>
> Jerry
>
>
> >> tree: array 0 for n 1 100000 1 [insert tail tree 1.0 * n]
> == []
> >> length? tree
> == 100000
> >> last tree
> == 100000
> >>
>
Oh I'm sorry I shouldn't have named the function insert !!
Try replacing the above with
tree: []
for n 1 100000 1 [insert-tree tree 1.0 * n]
After renaming the insert function:
tree-insert: func [tree item][
any [
all [tree = [] reduce [[] item []]]
all [
item < tree/:node reduce
[tree-insert tree/:left item tree/:node tree/:right]
]
reduce [tree/:left tree/:node tree-insert tree/:right item]
]
]
And you'll see a different result :)
Sorry for any confusion caused.
Gisle