Huffman Codes and Greedy Algorithms