huffman algorithm
I am just wondering how one would find the priority(by the standard below) if he/she is given the frequency..
would priority = 1/frequency work? higher frequency 10,9,8,7,6,5,4,3,2,1 higher priority 0,1,2,3,4,5,6,7,8,9 basically, higher Frequency(the number is bigger) -> Higer priority(number is smaller), so a priority of 0 will mean frequency of 10 |
I'm not sure what you mean... priority and frequency of what?
If you're saying that: frequency(10) = priority(0) frequency(9) = priority(1) ... then I guess subtract either one from 10 and you have the other. |
yes. that's what i mean. I will try that. thanks
|
Instead of doing that it's better trying to make the Huffman tree. It's quite easy. And do not need to be careful about priorities and frequencies.
|
All times are GMT -5. The time now is 04:47 PM. |