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...
Asked
Active
Viewed 2,101 times
1 Answers
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
-
It's a tenary tree and if my answer is good you must accept it. – Micromega Nov 30 '11 at 15:03
-
I used 0,1,2 to mark each branches and traverse the tree like a binary tree. Sorry because my English's so bad :( – hienvd Dec 01 '11 at 01:52