当前位置:网站首页>Basic concepts of Huffman tree
Basic concepts of Huffman tree
2022-07-07 03:25:00 【Muzi text_ Ah】
The basic concept of Huffman tree :
(1) route : It consists of branches from one node to another
(2) The length of the path : Number of branches on the path a→d The path length of = 2
(3) The path length of the tree : The sum of the path length from the tree root to each node . Case diagram :10
(4) power : A quantity given to an entity , It is a numerical description of the attributes of entities . If the nodes of the tree have weights , That is, the weighted tree .
(5) The weighted path length of the node : The product of the path length from node to root and the weight on the node d Weighted path length =72=14
(6) Weighted path length of tree : The sum of the weighted path lengths of all leaf nodes in the tree . Case diagram :27+25+22+2*4=36
(7) Huffman tree (Huffman): The best binary tree , The tree with the smallest weighted path length
The characteristics of Huffman tree
- The path length from the node with large weight to the root node is short ;
- The path length from the node with small weight to the root node is long .
Ø There is no degree in Huffman coding tree 1 The node of ;
Ø If given n Weight (n Leaf node ), Then the total number of points of Huffman tree is 2n-1;
Ø The height of Huffman tree does not exceed n.
The construction algorithm of Huffman tree :

Huffman code :
v Prefix encoding : The encoding of any character is not a prefix of the encoding of another character .
Such as : character a、b、c、d The codes of the two are respectively 0、1、01、10, be a The code of is c The prefix of the encoding ,b The code of is d Coded prefix , This code is not a prefix code .
When decoding , about 01011011 The decoding result of will not be unique .
v Huffman code
For a tree with n A leafy Huffman tree , Assign 0, The right branch gives 1, Then the path from the root to each leaf , Form a binary string respectively , This binary string is called Huffman code .
Do Huffman coding , Build Huffman tree first .
Huffman coding is prefix coding , And it's the best prefix code .
边栏推荐
- unrecognized selector sent to instance 0x10b34e810
- 如何自定义Latex停止运行的快捷键
- [swift] learning notes (I) -- familiar with basic data types, coding styles, tuples, propositions
- LAB1配置脚本
- About Confidence Intervals
- HDU ACM 4578 Transformation->段树-间隔的变化
- 如何替换模型的骨干网络(backbone)
- [tools] basic concept of database and MySQL installation
- Domcontentloaded and window onload
- 腾讯云原生数据库TDSQL-C入选信通院《云原生产品目录》
猜你喜欢

CVPR 2022 最佳论文候选 | PIP: 6个惯性传感器实现全身动捕和受力估计

Create applet from 0

“去虚向实”大潮下,百度智能云向实而生

装饰设计企业网站管理系统源码(含手机版源码)

Not All Points Are Equal Learning Highly Efficient Point-based Detectors for 3D LiDAR Point

Uniapp adaptation problem

【安全的办公和生产力应用程序】上海道宁为您提供ONLYOFFICE下载、试用、教程

源代码保密的意义和措施

杰理之在非蓝牙模式下,手机连接蓝牙不要跳回蓝牙模式处理方法【篇】

从0开始创建小程序
随机推荐
编译常量、ClassLoader类、系统类加载器深度探析
杰理之发射端在接收端关机之后假死机【篇】
VHDL实现任意大小矩阵加法运算
杰理之开 BLE 退出蓝牙模式卡机问题【篇】
校招行测笔试-数量关系
「小样本深度学习图像识别」最新2022综述
Starting from 1.5, build a micro Service Framework -- log tracking traceid
Install torch 0.4.1
Stored procedures and functions (MySQL)
[dream database] add the task of automatically collecting statistical information
Cocos2d-x Box2D物理引擎编译设置
[colmap] 3D reconstruction with known camera pose
【达梦数据库】添加自动收集统计信息的任务
Development of wireless communication technology, cv5200 long-distance WiFi module, UAV WiFi image transmission application
【C语言】 题集 of Ⅸ
SQL Tuning Advisor一个错误ORA-00600: internal error code, arguments: [kesqsMakeBindValue:obj]
MOS transistor realizes the automatic switching circuit of main and auxiliary power supply, with "zero" voltage drop and static current of 20ua
Codeforces Round #264 (Div. 2) C Gargari and Bishops 【暴力】
Experience design details
Room rate system - login optimization