C++ implementation of Huffman Encoding