add the Huffman Encoding algorithm (C++ version)