-3

I compressed the "abc" word into "01100111" using haffman coding algorithm . I built the tree . According to tree a=01, b=100 , c=111 . how to decompress this word ?

jotik
  • 17,044
  • 13
  • 58
  • 123
  • Have you tried to search the internet for solutions? - I DON'T THINK SO! So I did it for you: for example, see [these](https://www.cs.auckland.ac.nz/~jmor159/PLDS210/huffman.html) [three](http://arturocampos.com/cp_ch3-3.html) [webpages](https://www.mitpress.mit.edu/sicp/full-text/sicp/book/node41.html). – jotik Mar 31 '16 at 08:58
  • i tried . but i could not find good solution – Tharindu Dhanushka Mar 31 '16 at 09:02

1 Answers1

1

That is not a Huffman code. A Huffman code is a prefix code that uses all possible bit patterns. The prefixes 00, 101, and 110 are not used.

To decode a prefix code, you effectively traverse the tree starting at the root until you get to a leaf. Then you emit the symbol at the leaf and start over again at the root.

Mark Adler
  • 101,978
  • 13
  • 118
  • 158