- Objective: Compress text data
- Approach:
- Assume each letter is a single-node tree assigned a weight
represented by the frequency of the letter in the text
- Repeatedly merge the trees with the lowest weight
- Assign to each letter the binary string showing the path to the
letter from the root
-
- Codes that are not prefixes of one another are called prefix codes
- The algorithm provides optimal prefix codes
a:00, b:11, c:010, d:0110, e:10, f:0111