Uploaded by Abdul wadood Asim

133158121962724785

advertisement
Mirpur University of Science and Technology (MUST),
Mirpur-10250 (AJK), Pakistan
Department of Software Engineering
Course Title:
Course Code:
Instructor:
Marks:
Design & Analysis of Algorithm
CSD 205
Engr. Huma Sheraz
5
Session:
Semester:
Deadline:
CLO:
2020-2024
Fall-2022
19/12/2022
CLO-3
Assignment 01
Q#1(a): This is the Matrix chain order algorithm which finds the optimal way in multiplying matrices.
Here you are directed to find out overall complexity of algorithm. And do use max rule for getting the
block having the maximum complexity.
1. n ← p.length − 1
2. for i ← 1 to n do
3. m[i, i] ← 0
4. for l ← 2 to n do
5. for i ← 1 to n − l + 1 do
6.
j←i+l−1
7.
m[i, j] ← ∞
8.
for k ← i to j − 1 do
9.
q ← m[i, k] + m[k + 1, j] + pi−1pkpj
10.
if q < m[i, j] then
11.
m[i, j] ← q
12.
s[i, j] ← k
13. return s
Q#1(b): We are given a sequence as {4,5,3,6,2,3} where A1 , A2 , A3 ,A4 , A5 are the matrix with
following dimensions 4x5 , 5x3, 3x6, 6x2 , 2x3 .Then, we need to compute M [i,j], 0 ≤ i, j≤ 4. We know M
[i, i] = 0 for all i.
Department of Software Engineering, Mirpur University of Science and Technology (MUST). Allama Iqbal Road, Mirpur-10250 (AJK),
Pakistan Tel: +92-5827-961016 Fax: +92-5827-961016 , Email: Chairman.se@must.edu.pk
1/3
Mirpur University of Science and Technology (MUST),
Mirpur-10250 (AJK), Pakistan
Department of Software Engineering
Q#2: Write the Algorithm of given below statement for Miso Good food truck.
The Miso Good food truck produces a large variety of different lunch menu items. Unfortunately, they can
only produce their foods in limited quantities, so they often run out of popular items, making customers sad.
To minimize sadness, Miso Good is implementing a sophisticated lunch-ordering system. Customer’s text in
their acceptable choices before lunch time. Then they can use an algorithm to pre-assign lunches to customers.
Customers who do not get one of their choices should receive a $10 voucher. Miso Good would like to
minimize the number of vouchers they give out. Give an efficient algorithm for Miso Good to assign lunches
to customers. In general, suppose that, on a given day, Miso Good has produced m types of food items b1, . .
. , bm, and the quantity of each type of food item bj is exactly qj . Suppose that n customers a1, . . . , an text
in their preferences, where each customer ai submits a set Ai of one or more acceptable lunch choices. The
algorithm should assign each customer either one of his/her choices or a $10 voucher. It should minimize the
number of vouchers.
Good Luck 
Department of Software Engineering, Mirpur University of Science and Technology (MUST). Allama Iqbal Road, Mirpur-10250 (AJK),
Pakistan Tel: +92-5827-961016 Fax: +92-5827-961016 , Email: Chairman.se@must.edu.pk
2/3
Mirpur University of Science and Technology (MUST),
Mirpur-10250 (AJK), Pakistan
Department of Software Engineering
Wei
ghta
ge
proper
step wise
2
and
detailed
solution
Practice’s
reflection
1
Plagiarism
1
Conclusion
s
and 0.5
Evaluation
Reporting
0.5
(0-1)
(2-4)
(4)
(5)
Direct answer
Use of short cuts
Proper solution but
less explanation of
each step like formula
writing and direct
answer.
Proper solution with each
and every step-wise
explanation especially all
variable of formulas are
clearly explained which
must be understandable.
Use of all practices and
detailed explanations.
No use of practice e.g. if 50%
use
you are writing Algo. You practices.
are avoiding standards in
term
of
ambiguity,
completeness, conciseness
and correctness.
of
70% use of practices
More than 50 %
50 % copied
40% copied
20% Copied
Illogical
Attempts a conclusion or
evaluation that is illogical
or
inconsistent
with
evidence presented, or
omits a conclusion or
solution altogether.
Reasonable
Presents
abbreviated
or
simple conclusions
that are mostly
consistent
with
evidence presented,
with
minor
inconsistencies or
omissions
Logical
Clearly states and
discusses conclusions.
Organizes
a
conclusion or solution
that is complete,
logical, and consistent
with
evidence
presented
Perceptive
Clearly states and discusses
conclusions.
Considers
implications
and
consequences
of
the
conclusion
in
context,
relative to assumptions, and
supporting
evidence.
Provides reflective thought
with
regards
to
the
assertions
Poor
Figures, graphs, charts,
and drawings are of poor
quality, have numerous
inaccuracies
and
mislabeling, or may be
missing. There may be no
corresponding
explanatory text or there
may be redundancy with
the text.
Remotely related
For the only few
parts,
figures,
graphs,
and
drawings
are
accurate, consistent
with the text, and of
average
quality.
Only some of these
are referred to in the
text.
Relevant
For the most part,
figures,
graphs, and drawings
are
Accurate, consistent
with the text, and of
good quality. They
are generally labeled
correctly
in
accordance
with
engineering
standards. All are
referred to in the text.
Exemplary
All figures, graphs, charts,
and drawings are accurate,
consistent with the text, and
of good quality. They
enhance understanding of
the text. All are labeled
correctly in accordance
with engineering standards
and are referred to in
the text.
Department of Software Engineering, Mirpur University of Science and Technology (MUST). Allama Iqbal Road, Mirpur-10250 (AJK),
Pakistan Tel: +92-5827-961016 Fax: +92-5827-961016 , Email: Chairman.se@must.edu.pk
3/3
Related documents
Download