作者sm9195 (sm9195)
看板Grad-ProbAsk
标题[问题] Huffman 碰到一样的key时该怎麽办?
时间Mon Apr 6 12:16:32 2009
题目
Constuct a Huffman tree for the character:
a,b,c,d,e with 1/16, 1/16, 1/8, 1/4, 1/2, respectively.
e 1/2
/ \
d 1/4 1/4 ←当遇到一样时,放左边或放右边有差吗?
/ \
c 1/8 1/8 ←当遇到一样时,放左边或放右边有差吗?
/ \
b 1/16 a 1/16 ←当遇到一样时,放左边或放右边有差吗?
我搜了一下文章,了解到 Huffman tree 并不唯一,
但似乎没有特别说明「当遇到一样的key」时该怎麽做?
麻烦各位解说一下,感谢!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.116.121.70
1F:→ poga:没差 04/06 13:56
2F:→ sm9195:原来没有差。谢谢! 04/06 17:02
3F:推 acmonkey:有的老师会指定你排的顺序 没指定就没差 04/06 17:06