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?
Asked
Active
Viewed 170 times
1 Answers
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