早教吧作业答案频道 -->数学-->
为a,b,c,d,e,f,六个字母设计哈夫曼编码,他们在电文中出现的概率分别为0.25,0.25,0.20,0.15,0.10,0.05求其Huffman编码(请赋予大概率为0,小概率为1)及平均码长 .
题目详情
为a,b,c,d,e,f,六个字母设计哈夫曼编码,他们在电文中出现的概率分别为0.25,0.25,0.20,0.15,0.10,0.05
求其Huffman编码(请赋予大概率为0,小概率为1)及平均码长 .
求其Huffman编码(请赋予大概率为0,小概率为1)及平均码长 .
▼优质解答
答案和解析
取集合中最小的两个数字,做合并(加法),直到合并为一个节点(一棵树):
0.05,0.10,0.15,0.20,0.25,0.25
(0.05+0.10),0.15,0.20,0.25,0.25
((0.05+0.10)+0.15),0.20,0.25,0.25
((0.05+0.10)+0.15),(0.20+0.25),0.25
(((0.05+0.10)+0.15)+0.25),(0.20+0.25)
((((0.05+0.10)+0.15)+0.25)+ (0.20+0.25))
对树反过来编码,假定左树为0,右树为1:
0000,0001,001,01,10,11
把编码字母排序:
0000,0001,001,10,11,01
0.05,0.10,0.15,0.20,0.25,0.25
(0.05+0.10),0.15,0.20,0.25,0.25
((0.05+0.10)+0.15),0.20,0.25,0.25
((0.05+0.10)+0.15),(0.20+0.25),0.25
(((0.05+0.10)+0.15)+0.25),(0.20+0.25)
((((0.05+0.10)+0.15)+0.25)+ (0.20+0.25))
对树反过来编码,假定左树为0,右树为1:
0000,0001,001,01,10,11
把编码字母排序:
0000,0001,001,10,11,01
看了 为a,b,c,d,e,f,六...的网友还看了以下:
大家快来看看这几道题怎么简算!我急用!0.071*1234+0.71*567.6+7.1*23.4 2020-05-16 …
计算:(1)299.9×19.98-199.8×29.97;(2)3.14+64.8×0.537× 2020-07-09 …
口算72.5+37.5=8.09-4.16=1.25×8=4÷80=33.7-2.69=5.82+ 2020-07-09 …
(1.7*0.8)*251.765+3.089-0.760.25*36*40*0.50.125*1 2020-07-09 …
67.28+0.75*12.5/0.625-81.75+0.472.25*2.4+77.5*0.2 2020-07-17 …
口算.0.06×92.7+0.270.3×0.90.25×1.61.4÷20×0.4650.7×0 2020-07-19 …
我会巧算.1.2×0.4+1.3×0.4(1.25+0.36)×0.27.2×0.3+28×0.0 2020-07-19 …
直接写出得数2.3+5.6=1.2+0.8=306×3=2.67+0.73=25×24=3.59- 2020-07-19 …
口算0.67+0.3=12×0.5=3.2+1.8=0.8×25-10=54-1=17+15=1- 2020-07-25 …
取三支试管分别加入等量淀粉酶溶液,分为A、B、C组,并分别调整到0℃、25℃、100℃,然后在每支试 2020-11-07 …