Huffman coding
Similar ideas are used in modern data-compression techniques such as Huffman coding.