07-11-2014, 03:01 PM
[B] CS301 Data Structure Assignments No.4 Solution Fall 2014 Due Date 17th July 2014
Objective
The objective of this assignment is to make you familiar with the compression and compression technique like Huffman Encoding.
We have 21 characters. Of these, 17 characters are alphabets, 4 spaces . The ASCII code for space is 32.The ASCII value for ‘a’ is 95 and the value of A is 65. How many
bits we need to send 21 characters? As every character is of 8 bits, therefore for 21
characters, we need 21 * 8 = 168 we can save around 40% using the Huffman
algorithm.
Original text:
Deer is dear but dear
size: 21 characters (space)
Letters : Frequency
SP : 4
a : 2
b : 1
d : 3
e : 4
r : 3
h : 1
I : 1
S : 1
T : 1[/B]
