www.GetXFactor.com

Leading Technology, Science,
Agriculture News and information


Part of the Identityscape.com network...

getxfactor.com jmoodmusic.com smartbusinesschoices.com mintdepot.com lowfaresalways.com evangelicalview.com shoppingpodder.com soproudlywehail.com webnews.ws currenthumor.com

 

 

How to store a tree efficiently ?
   Science and Technology news... Forum Index -> Compression Forum  
View previous topic :: View next topic  
Author Message
Ray
Guest






PostPosted: Thu Sep 11, 2003 11:56 am    Post subject: How to store a tree efficiently ? Reply with quote

Root
|
--------------------------------------------------------
| | | | | | |
2 | ------- ---------- ----- | ---------------
7 | | | | | | | | | | | |
------ 2 4 3 3 2 1 | 4 3 ----- -----
| | 4 | | | |
----- 1 3 1 2 2
| |
2 3


I have a tree like this

how to store it as compact as possible ?
Back to top
Jesper Nordenberg
Guest






PostPosted: Thu Sep 11, 2003 3:54 pm    Post subject: Re: How to store a tree efficiently ? Reply with quote

a__l__k__@hotmail.com (Ray) wrote in message news:<514a7d7.0309102256.14ffe463@posting.google.com>...
[quote]Root
|
--------------------------------------------------------
| | | | | | |
2 | ------- ---------- ----- | ---------------
7 | | | | | | | | | | | |
------ 2 4 3 3 2 1 | 4 3 ----- -----
| | 4 | | | |
----- 1 3 1 2 2
| |
2 3


I have a tree like this

how to store it as compact as possible ?
[/quote]
I>m assuming that any tree node can have any number of sub-nodes
(children) and each leaf can have any value. One possible solution is
to recursively store each node as:

branch or leaf, 1 bit
number of children (for a branch) / value (for a leaf), n bits
<child node 1, if branch>
.....

To further decrease the space needed, compress the "number of
children/value" field using arithmetic or huffman coding. Or compress
the entire output using a good compression algorithm (like BWT).

/Jesper Nordenberg
Back to top
Ray
Guest






PostPosted: Fri Sep 12, 2003 6:16 pm    Post subject: Re: How to store a tree efficiently ? Reply with quote

megagurka@yahoo.com (Jesper Nordenberg) wrote in message news:<9c838fb.0309110254.575b32e7@posting.google.com>...
[quote]a__l__k__@hotmail.com (Ray) wrote in message news:<514a7d7.0309102256.14ffe463@posting.google.com>...
Root
|
--------------------------------------------------------
| | | | | | |
2 | ------- ---------- ----- | ---------------
7 | | | | | | | | | | | |
------ 2 4 3 3 2 1 | 4 3 ----- -----
| | 4 | | | |
----- 1 3 1 2 2
| |
2 3


I have a tree like this

how to store it as compact as possible ?

I>m assuming that any tree node can have any number of sub-nodes
(children) and each leaf can have any value. One possible solution is
to recursively store each node as:

branch or leaf, 1 bit
number of children (for a branch) / value (for a leaf), n bits
child node 1, if branch
....

To further decrease the space needed, compress the "number of
children/value" field using arithmetic or huffman coding. Or compress
the entire output using a good compression algorithm (like BWT).

/Jesper Nordenberg
[/quote]
Thanks Jesper... this is a compressing method...
manage to change a file into what I display above...

just need a way to store the tree as small as possible...
Back to top
George Buyanovsky
Guest






PostPosted: Sat Sep 13, 2003 12:58 am    Post subject: Re: How to store a tree efficiently ? Reply with quote

a__l__k__@hotmail.com (Ray) wrote in message news:<514a7d7.0309102256.14ffe463@posting.google.com>...
[quote]|
--------------------------------------------------------
| | | | | | |
2 | ------- ---------- ----- | ---------------
7 | | | | | | | | | | | |
------ 2 4 3 3 2 1 | 4 3 ----- -----
| | 4 | | | |
----- 1 3 1 2 2
| |
2 3

how to store it as compact as possible ?
[/quote]
You may found the article below useful.

http://www.ecs.csun.edu/~dsalomon/DC2advertis/QuadBuyan.pdf

--George
Back to top
Display posts from previous:   
   Science and Technology news... Forum Index -> Compression Forum  
Page 1 of 1
All times are GMT

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum