Processing math: 100%
Close
Close Window

CSC 201 Data Structures

Chapter 6 Binary Trees

Show Source |    | About   «  6.12. Array Implementation for Complete Binary Trees   ::   Contents   ::   6.14. Binary Search Trees  »

6.13. Huffman Coding

6.13.1. Huffman Coding

6.13.1.1. Coding

  • ASCII codes are fixed length (7 + 1 bits)
    • In general, n bits can store 2n codes

  • An alternative is variable-length coding

  • The relative frequencies for eight selected letters.

    LetterCDEKLMUZFrequency324212074224372

6.13.1.2. Huffman Coding Trees

1 / 16 Settings
<<<>>>

av_c1

32
C
42
D
120
E
7
K
42
L
24
M
37
U
2
Z
Proficient Saving... Error Saving
Server Error
Resubmit

6.13.1.3. Assigning Codes

1 / 16 Settings
<<<>>>

av_c6

Created with Raphaël 2.1.2
306
120
E
186
79
37
U
42
D
107
42
L
65
32
C
33
9
2
Z
7
K
24
M
Proficient Saving... Error Saving
Server Error
Resubmit

6.13.1.4. Using Codes

1 / 11 Settings
<<<>>>

av_c6

Created with Raphaël 2.1.2
306
120
E
186
79
37
U
42
D
107
42
L
65
32
C
33
9
2
Z
7
K
24
M
0
1
0
0
1
1
0
1
0
1
0
0
1
1
Proficient Saving... Error Saving
Server Error
Resubmit

6.13.1.5. Decoding

1 / 17 Settings
<<<>>>

av_c8

Created with Raphaël 2.1.2
E
120
L
42
C
32
M
24
U
37
D
42
Z
2
K
7
0
1
0
0
1
1
0
1
0
1
1
0
0
1
Proficient Saving... Error Saving
Server Error
Resubmit

   «  6.12. Array Implementation for Complete Binary Trees   ::   Contents   ::   6.14. Binary Search Trees  »

nsf
Close Window