This preview shows pages 1–2. Sign up to view the full content.
Cs445 — Homework #7 (optinal)
Dynamic programming, Stable marriage, and
Approximation algorithm
If you choose to submit this homework, its grade would replace yout
Due: 5/9/2005 at 11:59pm (deadline is Frm). If you are not in Tucson at this date,
you may submit via email to Rohit.
1. Show how to reduce the space requirement of ±loydWarshall algorithm to
O
(
n
2
).
2. How can you use ±loydWarshall algorithm to Fnd if the graph contains negative
cycles ?
3. Generate a sequence of 5 matrices
A
1
,A
2
,A
3
,A
4
,A
5
, and show how to optimally
compute the number of multiplication operations need to compute the product
A
1
·
A
2
·
A
3
·
A
4
·
A
5
. The smallest matrix has 5 rows, and the largest matrix
has at least 100 rows.
4. Apply the LCS algorithms on the sequences
X
=
pp
HHelloWWord
pp
and
Y
=
“
HeloWorld
pp
. Show the LCS table, and explain how do do you reconstruct the
LCS
(
X,Y
)
5. In the stable marriage algorithm
(a) describes an input where during there algorithm Θ(
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
 Spring '06
 Williams
 C Programming

Click to edit the document details