CS301-Assignment 2 Solution
CS301-Assignment 2 Solution
Please carefullv read the following instructions before attemntine the assignment Solution.
NOTE
Don't copy-paste the same
answer.
Make sure you can make some changes to your solution file before submitting
copy paste solution will be marked zero.
If you found any mistake then correct yourself and inform me.
Before submitting an Assignment GDB checks your assignment requirement file.
Consider the following string saved into a string type variable. We want to send it over the network to
another computer. Use the given string and answer (solve) the questions given below.
Character D a t S r u c e s i o n f h B ( C ) p g m Spac
e
Frequenc 1 3 4 3 6 3 3 5 4 1 6 1 2 1 1 1 1 1 1 1 1 10 1
Y
CONTACT ON WHATSAPP
+923074960034
Number 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
of Bits
used
without
any
encoding
Huffman
code of
each
character
Number
of Bits
used with 6 15 16 15 24 15 24 20 16 6 24 6 10 6 6 6 6 6 5 5 5 20 5
Huffman
encoding
b. Calculate how many bits will be used for the above string: [6 Marks]
Without using any encoding technique
Answer: Number of bits without any encoding technique = 61*8= 488 bits
With Huffman encoding technique
Answer: Number of bits by using Huffman encoding technique = 267 bits
What percentage of bits is saved by Huffman encoding scheme?
Answer: Percentage = ((488-267) / 488) * 100 = 45.28%
Every Assignment/GDB is change due to unique Student ID so don’t copy
That is truly perfect step by step idea solution get help easily.
CONTACT ON WHATSAPP
+923074960034