Huffman Encoding in C++