Data Compression


Criteria

Survey Formats

Basics

Compression Methods

Data Formats


Huffman Code

Example

Characteristics

Variants

Dynamic Huffman Code

Adaptive Huffman Code

Initialization

Algorithm

Example

 1. Symbol: 'a'

 2. Symbol: 'b'

 3. Symbol: 'r'

 4. Symbol: 'a'

...

11. Symbol: 'a'


Glossary

Index


Download


www.BinaryEssence.com

11. Symbol: 'a'


Current code tree


                Successor
No. Pred. Cont. "0"  "1"  Weight
 1.   3   NYA    -    -      0
 2.   3   "d"    -    -      1
 3.   7    -     1    2      1
 4.   7   "c"    -    -      1
 5.   8   "r"    -    -      2
 6.   8   "b"    -    -      2
 7.  10    -     3    4      2
 8.  10    -     5    6      4
 9.  11   "a"    -    -      4
10.  11    -     7    8      6
11.  Root        9   10     10

The current node is already the most significant node of the block. Therefore its weight may be incremented without exchange:


                Successor
No. Pred. Cont. "0"  "1"  Weight
 1.   3   NYA    -    -      0
 2.   3   "d"    -    -      1
 3.   7    -     1    2      1
 4.   7   "c"    -    -      1
 5.   8   "r"    -    -      2
 6.   8   "b"    -    -      2
 7.  10    -     3    4      2
 8.  10    -     5    6      4
 9.  11   "a"    -    -      5
10.  11    -     7    8      6
11.  Root        9   10     10

Continue with the predecessor of the current node:


                Successor
No. Pred. Cont. "0"  "1"  Weight
 1.   3   NYA    -    -      0
 2.   3   "d"    -    -      1
 3.   7    -     1    2      1
 4.   7   "c"    -    -      1
 5.   8   "r"    -    -      2
 6.   8   "b"    -    -      2
 7.  10    -     3    4      2
 8.  10    -     5    6      4
 9.  11   "a"    -    -      5
10.  11    -     7    8      6
11.  Root        9   10     10

The current node is already the most significant node of the block. Therefore its weight may be incremented without exchange:


                Successor
No. Pred. Cont. "0"  "1"  Weight
 1.   3   NYA    -    -      0
 2.   3   "d"    -    -      1
 3.   7    -     1    2      1
 4.   7   "c"    -    -      1
 5.   8   "r"    -    -      2
 6.   8   "b"    -    -      2
 7.  10    -     3    4      2
 8.  10    -     5    6      4
 9.  11   "a"    -    -      5
10.  11    -     7    8      6
11.  Root        9   10     11

The root node is reached, the update procedure will be terminated.


 <   ^   > 

Example abracadabra 4. Symbol: a Huffman Code