Huffman Coding based on optimal prefix code