给定权值 {19,01,23,14,55,20,84,27 },构造相应的哈夫曼树,计算WPL.
问题描述:
给定权值 {19,01,23,14,55,20,84,27 },构造相应的哈夫曼树,计算WPL.
答
243
/\
145 98
/\ /\
61 84 43 55
/\ /\
34 27 20 23
/\
15 19
/\
1 14
WPL=(84+55)*2+(27+20+23)*3+19*4+(1+14)*5=639