Download presentation

Presentation is loading. Please wait.

Published bySergio Rowles Modified about 1 year ago

1

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 I1S Sp 3 2 V1Y1 R2R2 4 7

10
11 E5E5 G3G3 2 N1N1 I1S1 3 6 Sp 3 2 V1Y1 R2R

11
6 4 G 3 I1S1 11 E5 2 N1 3 Sp3 2 V1Y1 R Huffman Code: E 10G 111N 1100I 11010S Sp 00V 0100Y 0101

12
6 4 I1S1 11 E5 2 N1 3 Sp3 2 V1Y1 R EVERY EGG IS GREEN Use this Huffman tree to code the sentence:

13
Huffman: EVERY EGG IS GREEN ASCII:

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: = 91 bits less 91/144 *100 = 62% less space used

Similar presentations

© 2016 SlidePlayer.com Inc.

All rights reserved.

Ads by Google