binary trees there are several approaches to compressing data for textthe most common approach is to reduce the number of bits that represent the most-used characters in englishe is often the most common letterso it seems reasonable to use as few bits as possible to encode it on the other handz is seldom usedso using large number of bits is not so bad suppose we use just two bits for esay we can' encode every letter of the alphabet in two bits because there are only four -bit combinations and can we use these four combinations for the four most-used charactersunfortunately not we must be careful that no character is represented by the same bit combination that appears at the beginning of longer code used for some other character for exampleif is and is then anyone decoding wouldn' know if the initial represented an or the beginning of an this leads to ruleno code can be the prefix of any other code something else to consider is that in some messages might not be the most-used character if the text is java source filefor examplethe (semicoloncharacter might appear more often than here' the solution to that problemfor each messagewe make up new code tailored to that particular message suppose we want to send the message susie says it is easy the letter appears lotand so does the space character we might want to make up table showing how many times each letter appears this is called frequency tableas shown in table table frequency table character count space linefeed the characters with the highest counts should be coded with small number of bits table shows how we might encode the characters in the susie message table huffman code character code