79200478

Date: 2024-11-18 15:19:53
Score: 0.5
Natty:
Report link

Try to run Huffman algorithm on the frequencies - you would see, that those codes could not be produced by a Huffman algorithm. Huffman always merges nodes with smallest frequencies, but to get those exact codes, you would have to merge nodes that are not smallest.

To get those codes, the following steps must be performed:

  1. A merged with B (both have a prefix of 10) for a total frequency of 7
  2. D merged with E (both have a prefix of 11) for a total frequency of 11
  3. AB merged with DE (both have a prefix of 1). But that's impossible for Huffman, because we are merging frequencies of 7 and 11, while C (frequency 8 ) is still present!

Note, however, that this code still gives each symbol the same number of bits as Huffman would. Because we know that Huffman is always an optimal prefix code - this code is also optimal.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: user22405329