I have just been hipped to the elegant method of storing binary
trees in arrays, which I never knew before.  Here is the kernel
of it:


        The root of the tree is always at position 0

        The parent of any node $N is at position int($N >> 1)

        The children of any node are at ($N << 1) and (($N << 1) +1)

        ( aka $N*2 and $N*2+1 )


        Are there any CPAN modules that use this technique to create
hash-like containers in the form of trees of [$key,$value] objects?




-- 
                                           David Nicol 816.235.1187
Refuse to take new work - finish existing work - shut down.

Reply via email to