Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use C to implement order-preserving Huffman coding Use the following Formula Sample input: 15 0.022222222 0.044444444 0.066666667 0.088888889 0.111111111 0.111111111 0.088888889 0.066666667 0.044444444 0.022222222 0.022222222
Use C to implement order-preserving Huffman coding
Use the following Formula
Sample input:
15 0.022222222 0.044444444 0.066666667 0.088888889 0.111111111 0.111111111 0.088888889 0.066666667 0.044444444 0.022222222 0.022222222 0.044444444 0.066666667 0.088888889 0.111111111
Sample output:
probabilities sum to 1.000000 Code tree for exact: 14 12 14 cost 0.422222 13 12 13 cost 0.155556 12 6 14 cost 1.688889 11 9 11 cost 0.133333 10 9 10 cost 0.044444 9 8 11 cost 0.266667 8 6 11 cost 0.711111 7 6 7 cost 0.155556 6 0 14 cost 3.777778 5 4 5 cost 0.222222 4 0 5 cost 1.088889 3 0 3 cost 0.422222 2 0 2 cost 0.200000 1 0 1 cost 0.066667 0 Codes & prob*# of bits 0 00000 0.111111 1 00001 0.222222 2 0001 0.266667 3 001 0.266667 4 010 0.333333 5 011 0.333333 6 1000 0.355556 7 1001 0.266667 8 1010 0.177778 9 101100 0.133333 10 101101 0.133333 11 10111 0.222222 12 1100 0.266667 13 1101 0.355556 14 111 0.333333 Expected bits per symbol 3.777778
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started