Which greedy algorithm is used to construct an optimal prefix code for lossless data compression?
Show answer
Huffman coding
Huffman coding builds a binary tree based on character frequencies, ensuring that the most frequent characters have the shortest codes. It produces an optimal prefix code for a given frequency distribution.
Also asked as:
- Which greedy algorithm generates an optimal prefix code for lossless compression?