Huffman tree program (code example)