哈尔曼夫树以及前缀编码

题目1:

The Huffman code is one kind of optimal prefix codes. For a given alphabet and its characters' frequencies,the Huffman codes may not be unique, but the Huffman code length of each character is unique. (错)

前缀编码可以不一样&&可以一样0,树的形态可以不一样&&可以一样,对于不同的字符的二进制编码长度可以不一样&&可以一样(比如a:0001 ,b:1111.长度都是4)

 

题目2:

Given a Huffman tree for N (≥2) characters, all with different weights. The weight of any non-leaf node must be no less than the weight of any node on the next lower level.

意思说非叶节点的节点他的权重值肯定大于或者等于他下一层节点的权值。这是对的 。

因为构建哈尔曼夫树的时候是采用贪心算法,每次选取根节点最小的树分别作为左右子树,新的根节点权值为这两个左右子树根节点权值之和。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值