Download presentation
Presentation is loading. Please wait.
Published bySergio Rowles Modified over 9 years ago
2
CREATING a HUFFMAN CODE
3
EVERY EGG IS GREEN E ///// V/V/ R // Y/Y/ I/I/ S/S/ N/N/ Sp /// V/V/ Y/Y/ I/I/ S/S/ N/N/ R // Sp /// G /// E /////
4
2 V1V1 Y1Y1 N1N1 V1V1 Y1Y1 I1I1 S1S1 N1N1 R2R2 G3G3 Sp 3 E5E5 I1I1 S1S1 N1N1 R2R2 G3G3 E5E5 2 V1V1 Y1Y1 R2R2 G3G3 S3S3 E5E5 2 I1I1 S1S1
5
N1N1 2 V1V1 Y1Y1 R2R2 G3G3 S3S3 E5E5 2 I1I1 S1S1 N1N1 2 I1I1 S1S1 3 2 V1V1 Y1Y1 R2R2 G3G3 S3S3 E5E5
6
2 V1V1 Y1Y1 R2R2 4 2 E5E5 N1N1 I1I1 S1S1 G3G3 Sp 3 3 N1N1 I1I1 S1S1 3 E5E5 2 G3G3 Sp 3 2 V1V1 Y1Y1 R2R2
7
2 2 E5E5 N1N1 I1I1 S1S1 G3G3 Sp 3 3 V1V1 Y1Y1 R2R2 4 G3G3 2 N1N1 I1S1 3 6 E5E5 Sp 3 2 V1Y1 R2R2 4
8
G3G3 2 N1N1 I1S1 3 6 Sp 3 2 V1Y1 R2R2 4 Sp 3 2 V1Y1 R2R2 4 7 E5E5 G3G3 2 N1N1 I1S1 3 6 E5E5
9
Sp 3 2 V1Y1 R2R2 4 7 E5E5 G3G3 2 N1N1 I1S1 3 6 E5E5 G3G3 2 N1N1 I1S1 3 6 11 Sp 3 2 V1Y1 R2R2 4 7
10
11 E5E5 G3G3 2 N1N1 I1S1 3 6 Sp 3 2 V1Y1 R2R2 4 7 18
11
6 4 G 3 I1S1 11 E5 2 N1 3 Sp3 2 V1Y1 R2 7 18 Huffman Code: E 10G 111N 1100I 11010S 11011 Sp 00V 0100Y 0101
12
6 4 I1S1 11 E5 2 N1 3 Sp3 2 V1Y1 R2 7 18 EVERY EGG IS GREEN Use this Huffman tree to code the sentence: 100100100110101001011111100110101101100111 01110101100
13
Huffman: EVERY EGG IS GREEN ASCII: 0100010101010110010001010101001001011001 0010000001000101010001110100011100100000 0100100101010011001000000100011101010010 010001010100010101001110
14
What is the per cent of saving in space when Huffman is used instead of ASCII? ASCII: 18 characters at 1 byte each = 144 bits Huffman: 53 bits Improvement: 144-53 = 91 bits less 91/144 *100 = 62% less space used
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.