哈夫曼树的课程设计

 

在计算机信息处理中,“哈夫曼编码”是一种一致性编码法(又称"熵编码法"),用于数据的无损耗压缩。我们会发现一些数据经常出现的频率高,有些出现的频率低。我们利用哈夫曼算法建立一棵哈夫曼树(最优二叉树),同时将数据出现的频率作为权值赋给哈夫曼树中的结点。根据建立好的哈夫曼树我们进行编码,从根结点出发在左子树则标为0,右则标为1。直到到指定的叶子结点,然后将遍历过程中标记的01代码存在一个数组中。以此实现将使用频率高的字符的编码尽可能的少,也就使得总的长度减少。在哈夫曼编码的基础上进行解码,就可以还原压缩的数据。

Abstract
In the computer information processing, "Huffman coding" is a consistent coding method (also known as "entropy coding method") for lossless data compression. We will find some of the data often appear in high frequency, some of the frequency of the low. Huffman algorithm we use to establish a Huffman tree (the optimal binary tree), while the frequency of the data as the weights assigned to Huffman tree nodes. According to our well-established Huffman coding, starting from the root node in the left subtree is marked as 0, the right is labeled 1. Up to the designated leaf nodes, and then traverse the process of marking the existence of a 0,1 code array. Implementation will be used as the character encoding of high frequency low as possible, thus making the total length of the reduction. In the Huffman coding based on the decoding, you can restore the compressed data.

 

 

 

 

 

第一章    课程设计目的... 4

  • 1
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 13
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值