Huffman tree construction and coding