Adaptive Huffman encoding in C++.