algorithm - Should Huffman compression be in strict order of frequency? -
i'm testing i've got on huffman encoding exercise. test file has lot of low frequency chars (mostly frequency of 1) , low number of high frequency chars. i'm testing what's being read off encoding tree; seems char frequency of 19 has 6 bits, char frequency of 10 has 3 bits, , char frequency of 5 has 5 bits. sort of anomaly expected or should in right order?
you have error in implementation. possible have wide range of frequencies same bit length, bit lengths should never reversed respect frequencies.
Comments
Post a Comment