Garmaine Staff asked 1 year ago

So once I have built my huffman tree and compressed a file into each characters' corresponding code how do I go about decompressing the file? In the compressed file I have to insert some sort of information representing the huffman tree built in order to decompress the file. I was initially thinking of storing the character with its' value for example:

a: 110 and b:11 for example. However, when reading the compressed file how would I differentiate the a from the b if both the a and b start with 11?

I don't feel like my method will work, does anyone have any better ideas?