2

I have a problem in my program implement Huffman encoding. In base 2, I use a binary tree to store codeword, but I don't know how to deal with base 3. I'm trying to use a trinary tree, but don't know how to implement it with a trinary, how to add 0,1,2 symbol...

hienvd
  • 346
  • 1
  • 5
  • 17

1 Answers1

0

I know little about the huffman tree but instead to use 0 and 1 to mark the branches in a ternary tree I would use the letters A,B and C for each branches. Then I can traverse the tree for a letter and remember the codeword for example: ABBCA.

Micromega
  • 12,486
  • 7
  • 35
  • 72