We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# Assignment No. 03 Semester: Fall 2015 CS502: Fundamentals of Algorithms

Instructions

It should be clear that your assignment will not get any credit if:

• The assignment is submitted after due date.
• The submitted assignment does not open or file is corrupt.
• Solution is copied from any other source.

Objective

The objective of this assignment is to;

• Learn the working of Huffman Encoding Algorithm
• Understand its application

Assignment

10 Marks

Part 1:

Suppose you are working in an office and want to send a large size text document to your boss via email. Your file is too large for sending as an email attachment as your email service provider allows you to send files only up to a certain size limit.

To cope with this issue, you decided to use Huffman encoding algorithm to compress your document size. Given below is the frequency table for characters used in that document.

 Character Frequency A 25 D 10 M 30 S 15 T 3 Y 55

10  Marks

Part 2:

In this part, you are provided with working code of Huffman algorithms huffman.cpp. The code is self explanatory and comments are added where necessary. This is a very nice, simple and powerful algorithm for compression.

We have applied this algorithm on two sample statements to get its encoded text. Output for both statements is given below.

You can see input statements and its associated results. Both input statements have same size (448 bits) but size of encoded text is different. You can verify the same results by running given code.

You need to understand the working of Huffman Algorithm. Attached C++ code will help.

You are required to explain the reasons behind difference in encoding/compression results. The first statement “A quick brown…” having size 448 bits was compressed to 259 bits after encoding. While the second statement “admission success…” having same size (448 bits) was compressed to 198 bits after encoding.

In above case, why one statement was compressed more than other by Huffman encoding algorithms?

Submission

You are required to submit your solution through LMS as MS Word document containing your answer to part 1 and your arguments and reasons to the given question in part 2.

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 19117

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Attachments:

### Replies to This Discussion

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

tree to ban gai 2nd question mein kia krna h koi bta de

tree share kr do phir

138

55           83

30         53

##### 25      28

15      13

10    3

this is the basic technique and arrangement

i hope you are understand

no mistake h is mein 43+40 =83 ap ne 85 likha hua
yes tree correct h

its incorrect

why incorrect?

ap ny nodes priority queue k accoring arrang nae keay

138

55           83

30         53

##### 25      28

15      13

10    3

AP plz detail main bat dain gin k krna kia hai assignmnt
bcz C++ progrm kion dyia gyia hai ??
Plz guide me if anyone know

## Latest Activity

15 minutes ago
28 minutes ago
34 minutes ago
Maham Raza. liked zohaib iftikhar's discussion ...*LAMBA DAGHA,...*
35 minutes ago
Amar Butt left a comment for Sadia Rani
1 hour ago
1 hour ago
Maham Raza. liked zohaib iftikhar's blog post No Title
1 hour ago
Furqan Awan posted a discussion

1 hour ago

### ...* JAWAN KI IBADAT ...*

1 hour ago
1 hour ago
Irfan Salim, Amar Butt, Ammara Malik and 4 more joined Virtual University of Pakistan
1 hour ago

1

2

3