mardi 2 décembre 2014

Huffman Tree Decompression


Vote count:

0




I a currently trying to decompress the compressed message of my Huffman Tree. Thus far I have created a string representation of the tree using the letter's I and L ('I' being an interior node, one that does not have a character and 'L' being a leaf, one with a character) as well as the character itself. I have also compressed the message into a series of 0's and 1's, with the standard 0 meaning go left and 1 meaning go right. For instance:


Hello world.

IIILrL ILwILeLdILlIILHL.Lo

1100011010101110010101110001001111101


I am now at the point where I need to decompress the message. However, this is a homework assignment and I do not have access to the original Huffman tree. The only things that I have access to in my decompress method are the tree string representation and the compressed message (IIILrL ILwILeLdILlIILHL.Lo and 1100011010101110010101110001001111101). I need to create a new tree and then traverse it to get my decompressed message.


I think that I understand how to traverse it using the 1's and 0's. However, I cannot figure out how to create the tree in the first place. The initial Huffman tree was constructed for us, but even upon studying it I do not think it is applicable (it would construct a tree of I's, L's, and other letters, each letter having only one frequency). I have looked through other questions on here as well as on the internet, but it seems that none apply since I do not have access to the original tree. Any help on how to construct this tree so that I can decompress my message would be greatly appreciated!



asked 1 min ago

S12

11






Huffman Tree Decompression

Aucun commentaire:

Enregistrer un commentaire