下载此文档

Huffman Codes算法设计与分析课程设计实验报告.doc


文档分类:高等教育 | 页数:约11页 举报非法文档有奖
1/11
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/11 下载此文档
文档列表 文档介绍
1 实验题目哈夫曼编码一、问题描述: Problem E Dan McAmbi isa member ofa crack counter-espionage team and has recently obtained the partial contents ofa file containing information vital to his nation! ˉs interests. The file had pressed using Huffman encoding. Unfortunately, the part of the file that Dan has shows only the Huffman codes themselves, not pressed information. Since Huffman codes are based on the frequencies of the characters in the original message, Dan! ˉs boss thinks that some information might be obtained if Dan can reverse the Huffman encoding process and obtain the character frequencies from the Huffman codes. Dan! ˉs gut reaction to this is that any given set of codes could be obtained from a wide variety of frequency distributions, but his boss is not impressed with this reasoned analysis. So Dan e to you to get more definitive proof to take back to his boss. Huffman encoding is an optimal pression method if you know in advance the relative frequencies of letters in the text to pressed. The method works by first constructing a Huffman tree as follows. Start with a forest of trees, each tree a single node containing a character from the text and its frequency (the character value is used only in the leaves of the resulting tree). Each step of the construction algorithm takes the two trees with the lowest frequency values (choosing arbitrarily if there are ties), and replaces them with a new tree formed by joining the two trees as the left and right subtrees ofa new root node. The frequency value of the new root is the sum of the frequencies of the two subtrees. This procedure repeats until only one tree is left. An example of this is shown below, assuming we have a file with only 5 characters ¨C A, B, C,D and E¨C with frequencies 10%, 14%, 31%, 25% and 20%, respectively. After you have constructed a Huffman tree, assign the Huffman codes to the characters as follows. Label each left branch of the tree with a0 and each right branch with a 1. Reading down from the r

Huffman Codes算法设计与分析课程设计实验报告 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数11
  • 收藏数0 收藏
  • 顶次数0
  • 上传人6188
  • 文件大小137 KB
  • 时间2017-05-26
最近更新