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

Re: saving binary tree to file



sreangsu acharyya wrote:
> 
> On Thu, 30 Nov 2000, Arun Sharma wrote:
> >
> > 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.
> >
> >       -Arun
> 
>   ummm ....if I store the information if the node owns a child or not, it
> should be possible to get the structure back. For example
> 
>                                   A
>                                 /   \
>                                B      C
>                                     /   \
>                                    D     E
> 
> This will be stored in the file as A,B,C,D,E

	i have not seem ur explanation.. but is this pre-order traversal..
	preorder : leftchild; root ; rightchild..
	clarify , if i am wrong...
	this was said in orig mail...

> 
|It is better to keep your mouth shut and be thought a fool, |
|            than to open it and remove all doubt.	     |
|------------------------------------------------------------|
|Ketan Mehta | Wipro | Bangalore | Ph 91-80-5722296/93-5240  |
|ketan.mehta@xxxxxxxxx | ketan_kmehta@xxxxxxxxxxxx (personal)|
|------------------------------------------------------------|