[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: saving binary tree to file

On Wed, Nov 29, 2000 at 10:06:08AM +0530, sreangsu acharyya wrote:
> Hello,
>   I need to save a binary tree (of lists) in a file. I think saving them
> in pre-order sequence should enable one to recreate it from the disk
> again. But what i want to know is, is it possible to use the db package to
> do the same or is there any other lazy way of doing it.
>   I read up the man pages of db but couldnt answer the question myself

You can't construct a binary tree from it's pre-order traversal sequence.
You can construct a balanced binary tree with the same data, but some
information about the original structure is lost.