CS301 Assignment 2 Solution Spring 2022

Dear Students, here we have uploaded CS301 Assignment 2 Solution Spring 2022. You can search for it CS301 Assignment 2 Solution 2022. Its CS301 Assignment 2 Idea Solution for your help and support. Students can download CS301 Assignment 2 Solution 2022 PDF from our website Raise For Success on free bases.


Data Structure is a subject that computer students study at Virtual University. It allows students to process data easier. It's an important subject for designing an efficient algorithm. Students have to prepare their CS301 Assignment 2 Solution by themselves.
Its Idea Solution CS301 Assignment 2 2022. And students have to make their own Unique Assignment 2 Solution CS301. This solution is CS301 Assignment 2 Solution Spring 2022 Provided By Raise For Success.
I mentioned to you CS301 Assignment 2022 the last date is 11 August 2022. The scenario of CS301 Assignment No. 2 is:
Problem Statement:

A competition of best quotes is being held in an educational institute. Administration of the institute will collect the quotes (messages) from students over the internet as a text file. A task assigned to you is to use the Huffman encoding technique and build a binary tree that will be used to encode and decode the content of text files. Consider the message given below that is saved in text files and received through the internet. You have to build a frequency table and Huffman encoding binary tree. Furthermore, calculate the efficiency of this encoding technique and calculate how much bandwidth is saved for compressing the files/messages of 10,000 students.

Text Message:

Education is one thing no one can take away from you

Solution Instructions:

  • You need to perform following step by step tasks to compress the message, calculate the efficiency and find bandwidth saved for the messages of 10,000 students:

Note: 

Consider all the characters/letters are in lowercase and new line characters are not used in the message.
Code is not required.
Solution:
Step 1:
Count all the letters including space from the given text message.
SOL:
Total 52 characters
Step 2:
Draw a table with column names (letter, frequency, original
bits, encoded bits)
Step 3:
Fill the table with letters, frequency, original bits (for
original bits get ASCII decimal code of each letter,
convert the decimal ASCII into 8 bits binary code) and
encoded bits (these can be found from Huffman encoding tree as mentioned in point 5).
SOL:
CS301 Assignment 2 Solution Spring 2022
Step 4:
Draw final Huffman encoding tree with the help of frequency table. (Step by step construction of Huffman encoding tree is not required, just show the final tree in the solution file).
Step 5:
Get the encoded bits from tree and fill code of each letter in last column of table constructed in step 2?
SOL:
CS301 Assignment 2 Solution Spring 2022

Step 6:

Calculate the efficiency of Huffman encoding technique. (For efficiency use total original bits, total compressed (encoded) bits and find what percentage of memory is saved with the help of Huffman encoding technique).

SOL:

Total 93 bits are required by using Huffman encoding method. Whereas if we send original message total characters are 52 each bit required 8 bits. So 52 * 8 = 416 bits will be required to send original message. This number of bits is 77% less than the number of bits in ASCII encoding form. 

Step 7:

For the calculation of bandwidth saved for 10,000 messages, use the calculation performed in step 6?

SOL:

For Message of 10,000 students we can just use 33% of total bandwidth and can save 77% bandwidth for 10,000 messages only 3300 messages bandwidth will be required.   

CS301 Assignment 2 Solution Spring 2022 PDF

Post a Comment

Previous Post Next Post