Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

+

Data Structures (CS301)


Total Marks: 20
Assignment # 03 Due Date: 12/07/2021

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:

 The assignment is submitted after due date.


 The submitted assignment file is not in “.doc” or “.docx” format.
 The submitted assignment file does not open or corrupted.
 The assignment is copied (from another student or internet).

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:

The objective of this assignment is to get hands on practice of

 Construction of frequency table


 Construction of Huffman Encoding tree
 Checking efficiency of Huffman encoding(compression) technique

For any query about the assignment, contact us at cs301@vu.edu.pk

Problem Statement: Marks 20


A text message “Virtual University” is frequently used over the network, which is using some amount of bandwidth. You
have assigned a task to compress the message “Virtual University” to reduce the bandwidth usage of network. Use
Huffman encoding technique to compress the given message, also calculate the efficiency of this encoding technique.

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:

This assignment will cover lectures 16 to 26.

Deadline:

Your assignment must be uploaded/submitted on/before Monday, July 12, 2021.

You might also like