Data Structures (CS301) Assignment # 03 Semester Spring 2021
Data Structures (CS301) Assignment # 03 Semester Spring 2021
Instructions:
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit (marks) if:
Uploading instructions:
Do not wait for grace day. Grace day is given only if there is problem with LMS on due date. Submit your solution
within due date.
It is clearly mentioned to submit your solution only in “.doc/.docx” format. Assignment submitted in any other format like
PDF, CPP, Any Image, Screenshot etc. will get zero marks.
Objective:
You need to perform following step by step tasks to compress the message and calculate the efficiency:
1. Count all the letters including space from the given text message.
2. Draw a table with columns name letter, frequency, original bits, encoded bits
3. Fill the table with letters, frequency and original bits (for original bits get ASCII code of each letter
convert the decimal ASCII into 8 bits binary code).
4. Draw final Huffman encoding tree with the help of frequency table. (Step by step construction of
Huffman encoding tree is not required).
5. Get the encoded bits from tree and fill code of each letter in last column of table constructed in step 2.
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).
Please note, double quotes and new line characters should not be included in text message.
____________________
Lectures Covered:
Deadline: