huffmanTree build and huffman Coding
来源:互联网 发布:海纳百川软件安卓版 编辑:程序博客网 时间:2024/05/29 08:20
huffMan Tree:
Imagine that here is one article , which contains 27 'A' , 8 'B' ...and 5 'F' :
A 27 , B 8 , C15, D15, E30 ,F5
So now build a Huffman tree
(1)take first TWO numbers , (2)construct one tree,left value is smaller than right side(3) then insert the ROOT into the sequence, (3)thenORDER the numbers .
1> order the numbers .
F5 , B8, C15, D15, A27, E30
2>
P13 ,C15 ,D15 ,A27 ,E30
/ \
F5 B8
3>
4>
D15 A27 P28 E30
/ \
P13 C15
/ \
F5 B8
5>
P42 P28 E30
/ \ / \
D15 A27 P13 C15
/ \
F5 B8
6> P28 E30 P42
/ \ / \
P13 C15 D15 A27
/ \
F5 B8
7>
P58
/ \ P42
P28 E30 / \
/ \ D15 A27
P13 C15
/ \
F5 B8
8> P100
/ \
/ \
P42 P58
/ \ / \
D15 A27 P28 E30
/ \
P13 C15
/ \
F5 B8
now let's say Left EDGE is 0 , right EDGE is 1
so for gets the huffman codes :
A:01
B:1001
C:101
D:00
E:11
F:1000
so the codes should be
01100110100111000
then analysis the sequence :
1>take each 0/1 , start from root search node ,till can not reach
2>remove the 0/1 already taken
3>loop
then will get huffman tree.
Imagine that here is one article , which contains 27 'A' , 8 'B' ...and 5 'F' :
A 27 , B 8 , C15, D15, E30 ,F5
So now build a Huffman tree
(1)take first TWO numbers , (2)construct one tree,left value is smaller than right side(3) then insert the ROOT into the sequence, (3)thenORDER the numbers .
1> order the numbers .
F5 , B8, C15, D15, A27, E30
2>
P13 ,C15 ,D15 ,A27 ,E30
/ \
F5 B8
3>
P28 D15 A27 E30
/ \
P13 C15
/ \
F5 B8
4>
D15 A27 P28 E30
/ \
P13 C15
/ \
F5 B8
5>
P42 P28 E30
/ \ / \
D15 A27 P13 C15
/ \
F5 B8
6> P28 E30 P42
/ \ / \
P13 C15 D15 A27
/ \
F5 B8
7>
P58
/ \ P42
P28 E30 / \
/ \ D15 A27
P13 C15
/ \
F5 B8
8> P100
/ \
/ \
P42 P58
/ \ / \
D15 A27 P28 E30
/ \
P13 C15
/ \
F5 B8
now let's say Left EDGE is 0 , right EDGE is 1
so for gets the huffman codes :
A:01
B:1001
C:101
D:00
E:11
F:1000
so the codes should be
01100110100111000
then analysis the sequence :
1>take each 0/1 , start from root search node ,till can not reach
2>remove the 0/1 already taken
3>loop
then will get huffman tree.
- huffmanTree build and huffman Coding
- Huffman coding.
- coding Huffman。。。
- huffman coding
- Huffman coding
- Huffman Coding
- HuffmanTree的实现及Huffman编码
- Huffman - coding with matlab
- <Sicily>Huffman coding
- Huffman coding length
- Huffman Coding V1
- 1003. Huffman Coding
- HuffmanTree
- HuffmanTree
- HuffmanTree
- HuffmanTree
- HUffmanTree
- Compression Deep Neural Networks With Pruning, Trained Quantization And Huffman Coding
- 写一个块设备驱动
- 在UltraEdit中使用正则表达式
- ios Parse推送详解
- chm文档的生成
- DBMS_STATS.GATHER_SCHEMA_STATS介绍使用
- huffmanTree build and huffman Coding
- Android_OTT的wifi热点建立
- 【推荐】关于JS中的constructor与prototype【转】
- 【转载】View的setOnClickListener的添加方法
- 大数据时代创业难:盘点未来十大初创企业
- web service测试
- df:查看linux剩余空间大小
- Gaea源码阅读(五):C客户端
- Web Service测试工具小汇