zoukankan      html  css  js  c++  java
  • Huffman codes

       

    Huffman codes  compress data very effectively: savings of 20% to 90% are typical, depending on the characteristics of the data being compressed. 

      功能:

      huffman 编码能有效的压缩数据。

      如何解决:

      Huffman’s greedy algorithm uses a table giving how often each character occurs (i.e., its frequency) to build up an optimal way of representing each character as a binary string. 

      

      we interpret the  binary codeword for a character as the simple path from the root to that character ,where 0 means go to the left child and 1 means  go to the right child .

      

    we interpret the  binary codeword

    for a character as the simple path from the root to that character ,where 0 means go to the left child and 1 means  go to the right child .

    Note that these are not binary search trees, since the leaves need not appear in sorted order and internal nodes do not contain character keys.

    an optimal code for a  file is always represented by a fully binary tree ,in which every nonleaf has two children .

    the tree for an optimal prefix code has exactly |C| leaves ,one for each letter of the alphabet ,ash exactly |c|-1interanl nodes .

    what is the meaning 

    when we merge two objects ,the result is a new object whose frequency is the sum of the frequencies of the two object that were merged . 

       

  • 相关阅读:
    Vue状态管理
    Vue延迟点击
    Vue路由
    简单的队列应用
    Uncaught SyntaxError: Unexpected token )
    视频转码
    判断是否为视频文件
    Press ^C at any time to quit.
    Node.js学习
    YUM安装LAMP与LNMP
  • 原文地址:https://www.cnblogs.com/ljlkfx/p/4438089.html
Copyright © 2011-2022 走看看