当前位置:网站首页>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 .
边栏推荐
- OC, OD, push-pull explanation of hardware
- 【达梦数据库】添加自动收集统计信息的任务
- Another million qubits! Israel optical quantum start-up company completed $15million financing
- Jerry's FM mode mono or stereo selection setting [chapter]
- Laravel php artisan 自动生成Model+Migrate+Controller 命令大全
- Uniapp adaptation problem
- 【C语言】 题集 of Ⅸ
- Numpy中排序操作partition,argpartition,sort,argsort
- 【达梦数据库】备份恢复后要执行两个sql语句
- The solution of unable to create servlet file after idea restart
猜你喜欢
树莓派设置静态ip
Le tube MOS réalise le circuit de commutation automatique de l'alimentation principale et de l'alimentation auxiliaire, et la chute de tension "zéro", courant statique 20ua
leetcode
源代码保密的意义和措施
Don't you know the relationship between JSP and servlet?
Not All Points Are Equal Learning Highly Efficient Point-based Detectors for 3D LiDAR Point
RestClould ETL 社区版六月精选问答
21.(arcgis api for js篇)arcgis api for js矩形采集(SketchViewModel)
Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]
Centerx: open centernet in the way of socialism with Chinese characteristics
随机推荐
C language string sorting
Make (convert) ICO Icon
What about SSL certificate errors? Solutions to common SSL certificate errors in browsers
New benchmark! Intelligent social governance
[untitled]
DOMContentLoaded和window.onload
24.(arcgis api for js篇)arcgis api for js点修改点编辑(SketchViewModel)
Shangsilicon Valley JVM Chapter 1 class loading subsystem
Domcontentloaded and window onload
Open3D 网格滤波
Tencent cloud native database tdsql-c was selected into the cloud native product catalog of the Academy of communications and communications
Le tube MOS réalise le circuit de commutation automatique de l'alimentation principale et de l'alimentation auxiliaire, et la chute de tension "zéro", courant statique 20ua
Jericho is in non Bluetooth mode. Do not jump back to Bluetooth mode when connecting the mobile phone [chapter]
ubuntu20安装redisjson记录
Shell 编程基础
应用程序启动速度的优化
杰理之开 BLE 退出蓝牙模式卡机问题【篇】
Jerry's question about DAC output power [chapter]
迷失在MySQL的锁世界
密码学系列之:在线证书状态协议OCSP详解