-2

Is there a way to recreate a huffman tree on the GPU using only the frequency and symbol? Also is it fast or even worth the trouble to do?

Eddi3
  • 59
  • 1
  • 8

1 Answers1

1

No. The Huffman code is not uniquely determined by the frequencies of the symbols. There are many different optimal codes for the same set of frequencies.

What you want is a canonical Huffman code, which defines exactly what code to generate given only the symbols and the number of bits for each symbol. You do not need to transmit frequencies or a tree.

Mark Adler
  • 101,978
  • 13
  • 118
  • 158