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

Looking For Something at vustudents.ning.com? Click Here to Search

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

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Fundamentals of Algorithms (CS502)

Assignment#02

Total marks = 20

 Submission Deadline =10-01-2018

Lectures Covered:Thisassignment covers Lecture # 23 to 26.

Objectives:

Objectives of this assignment are:

  • To implement Activity Selection Algorithm in real life problems
  • Generation of Variable-length codes using Huffman Coding Algorithm

 

Instructions:

Please read the following instructions carefully before solving & submitting the assignment:

  1. The assignment will not be accepted after due date.
  2. Zero marks will be awarded to the assignment that does not open or the file is corrupt.
  3. The assignment file must be an MS Word (.doc/.docx) file format; Assignment will not be accepted in any other format.
  4. Zero marks will be awarded to the assignment if copied (from other student or copied from handouts or internet).
  5. Zero marks will be awarded to the assignment if the Student ID is not mentioned in the assignment file.

 

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

Please do not post queries related to assignment on MDB.


 

Question # 1:                                                     10Marks (5+5)

 

 

In the context of Activity Selection Problem, consider the following set of activities:

 

Activity

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

Start

Time

2

4

6

1

6

3

1

8

5

6

7

4

2

5

7

Finish Time

9

5

7

3

8

5

2

9

8

9

9

8

3

6

8

 

 

You are required to find the optimal solution (usingGreedy Algorithm) for the following two greediness approaches:

 

  1. Select the activities that start first and schedule them(5 marks)
  2. Select the activities that finish first and schedule them(5 marks)

 

 

Note:

No need to provide any pseudo/working code. Just provide the results for each greediness approach of the following two steps in the below mentioned tabular form:

  1. Sorted Activities
  2. Final Selected Activities

 

Activity

 

 

 

 

 

 

 

StartTime

 

 

 

 

 

 

 

Finish Time

 

 

 

 

 

 

 

 

 

 

 

 

Question # 2:                                                               10 Marks

 

Consider the following scenario in which a set of Alphabets along with their frequencies is given.  You are required to generate the output binary tree and find the Variable-length codes for the given Alphabets using the provided Huffman Coding Algorithm.

 

Total File Length: 210

Frequency table:

A

B

C

D

E

F

10

20

30

40

50

60

 

Huffman Coding Algorithm:

  1. Consider all pairs: <frequency, symbol>.
  2. Choose the two lowest frequencies, and make them brothers, with the root having the

combined frequency.

 

  1. Iterate.

 

 

 

Note:

No need to provide all the steps of the binary tree generation.  Only mention the Final Binary Tree and the Variable-length codes for the given Alphabets in tabular form.

Your solution should be strictly according to the below-mentioned template.

 

Solution Template:

Alphabets: A, B, C, D, E, F

Total File Length: 100

Frequency table:

A

B

C

D

E

F

45

13

12

16

9

5

 

Output Tree:

Letter to be encoded

A

B

C

D

E

F

Frequency

45

13

12

16

9

5

Variable-length code

 0

 101

100 

 111

1101 

1100 

 

 

 

 

Good Luck

+ How to Follow the New Added Discussions at Your Mail Address?

+ 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?


See Your Saved Posts Timeline

Views: 12091

.

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

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

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Attachments:

Replies to This Discussion

Complete solution requrired plz

q.1 ka part 1 bta do koi??plzzz

complete solution uploaded if any mis take plz comments

Attachments:

fazal ur rehman bhi ap na ya solution ma qno1 k kon sa part solve kiya ha

fazal ap ny q1 ko just finish time k hisaab sy sctivity schedule ki hai jb k hmy asa e process i think start k lyhaz sy b krna hai 

ji janta hn likhn just idea dya hy bs 

but you wrote above its a complete solution, now you are saying just idea diya hai 

bro agr itna gusa a rha hy to na dekho ap us ko apni bnaa lo 

jtna mujhy laga thk hy mi n bnaa di bs 

apne kar liya assignment ??

complete solution upload krn na

Question no1 part 1 main first start activity k hisab s arrange krna hay pir final selected activity main table fill krna jis main start time aik jaisa na ho ko slect kr k fill kr lain aur aik activity ka end dosary activity ka start ho. issi tarah question no 1 ka part 2 b solve kr lo

yaha files upload ki hui hay wahan s check kr lain

thnx

RSS

Latest Activity

Aqsa Khan updated their profile
2 minutes ago
+ IUUOƆƎUT + updated their profile
2 minutes ago
+ M.Tariq Malik replied to Aijaz khan's discussion CS608 - Software Verification and Validation Assignment No. 2 Need Solution
9 minutes ago
+ M.Tariq Malik liked Aijaz khan's discussion CS608 - Software Verification and Validation Assignment No. 2 Need Solution
10 minutes ago
+ M.Tariq Malik replied to Waseem Aziz's discussion PROJECT MANAGEMENT (MGMT627)required Solution in the group MGMT627 Project Management
10 minutes ago
+ M.Tariq Malik liked Waseem Aziz's discussion PROJECT MANAGEMENT (MGMT627)required Solution
10 minutes ago
Ahsan Sandhu updated their profile
11 minutes ago
Ahsan Sandhu liked Ahsan Sandhu's profile
12 minutes ago
+ M.Tariq Malik replied to +¢αяєℓєѕѕ gιяℓ's discussion Best Places To Propose Someone :-P
12 minutes ago
+ M.Tariq Malik liked +¢αяєℓєѕѕ gιяℓ's discussion Best Places To Propose Someone :-P
13 minutes ago
+ M.Tariq Malik replied to waqas ahmad's discussion isl 201
13 minutes ago
+ M.Tariq Malik liked waqas ahmad's discussion isl 201
13 minutes ago
+ M.Tariq Malik replied to +¢αяєℓєѕѕ gιяℓ's discussion CS408 Human Computer Interaction Online Quiz No 01 Fall 2019 Solution Discussion Last Date: 21-11-2019 in the group CS408 Human Computer Interaction
17 minutes ago
+ M.Tariq Malik liked + IUUOƆƎUT +'s discussion List of Topics BNK619 by VU
17 minutes ago
+ M.Tariq Malik liked Azhar Sagar's discussion How to make srs Software Requirements Specification
17 minutes ago
+ M.Tariq Malik liked Ikra butt's discussion CS504 QUIZ NO 1 SOLUTION WITH COMPLETE GUIDELINES 2019
18 minutes ago
Azhar Sagar liked Azhar Sagar's discussion How to make srs Software Requirements Specification
18 minutes ago
+ M.Tariq Malik replied to Muhammad Younas Rajpoot's discussion ECO404 assignment 1 fall semester dated 19-11-2019
18 minutes ago
+ M.Tariq Malik liked Muhammad Younas Rajpoot's discussion ECO404 assignment 1 fall semester dated 19-11-2019
19 minutes ago
+ IUUOƆƎUT + added a discussion to the group BNKI619 Internship Report-Banking
19 minutes ago

Today Top Members 

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service