A big tree / hash problem, maybe a bug
Posted: Fri Sep 03, 2010 4:22 pm
I'm expecting some problems in creating big hashes, when running the following code.
The code creates a hash and inserts 20000 random values into it.
On the first iteration (show-size) returns 20000
After running (fill-tree) another round the function (show-size) returns 39998
Doing this again will return 59995.
Am I doing something wrong with the hashes?
Cheers
Hilti
Code: Select all
(define Bigtree:Bigtree)
(new Tree 'Bigtree)
(define (fill-tree)
(for (x 1 20000)
(Bigtree (string (random 10 5)) (string (random 5 5)))
)
)
(define (show-size name)
(length name)
)
(define (show-tree name)
name
)
(fill-tree)
(show-size (Bigtree))
On the first iteration (show-size) returns 20000
After running (fill-tree) another round the function (show-size) returns 39998
Doing this again will return 59995.
Am I doing something wrong with the hashes?
Cheers
Hilti