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 . 

       

  • 相关阅读:
    进度条与拖动条的使用学习
    双指针,BFS和图论(三)
    dubbo文档笔记
    ByteBuf
    Netty源码解析—客户端启动
    Netty源码解析---服务端启动
    java并发程序和共享对象实用策略
    docker命令
    elasticSearch基本使用
    Filebeat6.3文档—Log input配置
  • 原文地址:https://www.cnblogs.com/ljlkfx/p/4438089.html
Copyright © 2011-2022 走看看