# Cs301 Assignment 2 Solution Spring 2022

CS301 Assignment 2 Solution Spring 2022

If you are looking for CS301 Assignment 2 Solution Spring 2022? then you visit the right site. Here CS301 Assignment 2 Solution Spring 2022.

Don’t wait for a gracious day. The deferral date is only given if there is a problem with the LMS on the due date. Submit your solution by the deadline. The aim of this assignment is to gain practical experience. Construction of a frequency table. Construction of a Huffman coding tree. Checking the effectiveness of the Huffman coding compression technique.

Cs301 Assignment 2 Solution Spring 2022

Problem Statement:

A competition for the best quotes is held at the educational institute. Institute administration will collect citation reports from students over the Internet as a text file. The task you have been given is to use the Huffman coding technique and create a binary tree that will be used to encode and decode the contents of text files. Consider the message below that is stored in text files and received over the Internet. You need to build a frequency table and a Huffman coding binary tree. Next, calculate the efficiency of this encoding technique and calculate how much bandwidth is saved to compress the message files of 10,000 students.

Cs301 Assignment 2 Solution Spring 2022

Solution instructions:

To compress the message, calculate the efficiency, and find the bandwidth saved for the messages of 10,000 students, you must perform the following tasks:

1. Count all letters including spaces from a given text message.
2. Draw a table with column names (letter, frequency, original bits, encoded bits)
3. Fill the table with the letters, the frequency, the original bits (for the original bits, get the ASCII decimal code of
4. each letter, convert the decimal ASCII to 8-bit binary code) and the encoded bits (these can be found from the
5. Huffman coding tree as shown in point 5).
6. Draw the final Huffman coding tree using the frequency table. (Construction of the Huffman coding tree step by step is not required, just display the final tree in the solution file).
7. Get the encoded bits from the tree and fill in the code of each letter in the last column of the table created in step 2.
8. Calculate the efficiency of the Huffman coding technique.
9. (For efficiency, use the total number of original bits, the total number of compressed (encoded) bits and see
10. what percentage of memory is saved using the Huffman coding technique).