CS702 - Advanced Algorithms Analysis and Design: Instructions To Solve Assignments
CS702 - Advanced Algorithms Analysis and Design: Instructions To Solve Assignments
CS702 - Advanced Algorithms Analysis and Design: Instructions To Solve Assignments
Fall 2017
Assignment 2
The purpose of the assignments is to give students hands on practice. It is expected that
students will solve assignments themselves.The Following rules that will apply during
the evaluation of the assignment.
Cheating from any source will result in zero marks in the assignment.
Any student found cheating in any two of the assignments submitted during the
course will be awarded "F" grade in the course.
No assignment after the due date will be accepted.
1
Virtual University of Pakistan
Fall 2017
Answer the following questions in your own words. Plagiarism will be checked for
each question. Marks will be awarded on the basis of the answer and plagiarism
report.
Order of A1 = 20 x 30
Order of A2 = 30 x 10
Order of A3 = 10 x 15
Order of A4 = 15 x 25
Order of A5 = 25 x 15
Solution:
Following Recursive formulation will be used to device the solution
m[i, j] 1 2 3 4 5
1 0 6000 9000 14750 16500
2 0 4500 11250 12000
3 0 3750 7500
4 0 5625
5 0
s[i, j] 2 3 4 5
1 1 2 2 2
2 2 2 2
3 3 4
4 4
2
Virtual University of Pakistan
Fall 2017
5 5 8 6 4 7
1 2
5 4 1 6 3
In Out
1 4 5 3 1
4 3 7 6 2 5 7 6
Solution:
fi[j] 1 2 3 4 5 6
1 6 11 19 25 29 35
2 7 14 20 22 27 34
li[j] 2 3 4 5 6
1 1 1 1 1/2 2
2 2 2 1/2 2 2
f* = 37, l* = 1
3
Virtual University of Pakistan
Fall 2017