Ariel Scolnicov wrote:
> This only works for complete binary trees, of course. You cannot
> e.g. represent this tree (without wasting an exponential amount of
> space, that it):
>
> /\
> /\
> /\
> /\
> /\
> /\
> /\
> /\
>
> So it's mostly used for very specific trees. There's a standard way
> to build a heap which works this way.
Hashes also waste a lot of space. Something balanced might use less
space than a hash. Depends on the data, of course.
--
David Nicol 816.235.1187
Refuse to take new work - finish existing work - shut down.
- binary trees in arrays David L. Nicol
- Re: binary trees in arrays Ariel Scolnicov
- Re: binary trees in arrays David L. Nicol
- Re: binary trees in arrays Ariel Scolnicov
- Re: binary trees in arrays Michael G Schwern
- Re: binary trees in arrays Robin Houston
- Re: binary trees in arrays David L. Nicol
- Re: binary trees in arrays Tony Bowden
- Re: binary trees in arrays Michael G Schwern
