I have this homework: finding the code words for the symbols in any given alphabet. It says I have to use binary Huffman on groups of three symbols. What does that mean exactly? Do i use regular Huffman on [alphabet]^3? If so, how do I then tell the difference between the 3 symbols in a group?
Share
I can’t quite tell, because your description of the problem isn’t all that detailed, but I would guess that they mean that instead of encoding each symbol in your alphabet individually, you are supposed to tread each triple of symbols as a group.
So, for instance, if your alphabet consists of
a,b, andc, instead of generating an encoding for each of those individually, you would create an encoding foraaa,aab,aac, etc. Each one of these strings would be treated as a separate symbol in the Huffman algorithm; you can tell them apart simply by doing string comparison on them. If you need to accept input of arbitrary length, you will also need to include in your alphabet symbols that are strings of length 1 or 2. For instance, if you’re encoding the stringaabacab, you would need to break that down into the symbolsaab,aca, andb.Does that help answer your question? I wasn’t quite sure what you’re looking for, so please feel free to edit your question or reply in a comment if this hasn’t cleared anything up.