huffman algorithm based on heap