C++ code for Huffman's algorithm