You are on page 1of 4

Assignment No.

02
Total Marks: 20
Spring 2022
CS502- Design and Analysis of Algorithms Due Date: 17-08-2022

Instructions
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit (zero marks) if:
 The assignment is submitted after due date.
 The submitted assignment is other than MS Word file.
 The submitted assignment does NOT open or file is corrupted.
 The assignment is copied (from other student or ditto copy from handouts or internet).

Uploading instructions
For clarity and simplicity, you are required to upload/submit only one .doc/docx file.

Objectives
The objectives of this assignment are;

 To be able to understand and implement Huffman Encoding Algorithm


 To make you familiar with Graphs and Graph Traversal.
 To be able to solve DFS – Time Stamp structure.

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

Good Luck!
Question No. 1 Marks: 5
Huffman Coding is a data compression technique that reduces the size of data without sacrificing any of the
features. You have been given characters and their prefix codes in the following table.
You are required to make a Huffman Code tree.

Letter Prefix Code


A 000
B 001
C 010
D 011
E 100
F 101
N 110
Question No. 2 Marks: 15
Consider the following DFS Time Stamped Graph. You are required to fill the table. Sample entry for tree edge is
given in the first column.

Table to Fill

Tree Edges Forward Edges Back Edges Cross Edges


A-B

4/5
Lectures Covered: Lecture No. 23 to 31.
Deadline: Your assignment must be uploaded / submitted on or before.

Total Marks: 20

You might also like