• 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 . 

       

  • 相关阅读:
    vim
    Windows Scripting Host
    html5的新特性
    如何设置网页的搜索关键字
    Css Rest 方法
    javascript绑定事件
    AJAX 跨域请求
    转载ajax
    jQuery的hover()方法(笔记)
    无缝滚动案例解析
  • 原文地址:https://www.cnblogs.com/ljlkfx/p/4438089.html
Copyright © 2020-2023  润新知