Just below you will see why. As you can see, we represent a sequence of bits as a string containing 0's and 1's. If you know a better way of doing this, please let me know. This function will actually delete the contents of the code as the characters are being used. This might seem stupid, but it is smart when we want to use this function to decode Huffman-encoded strings instead of just one character.
Examples Let's just have a quick look at some examples.
Using Huffman encoding on such a character stream can compress the stream a lot. So, look forward to the forthcoming articles. I know that probably a lot can be done to refine the functions listed above. If you happen to write nicer versions of the functions, please send them to me at Ole Friis. All Rights Reserved.