This preview shows page 1. Sign up to view the full content.
Unformatted text preview: COT 5405, Test 3
SOLUTIONS
1. (10 points)
Let T [i] be an optimal proﬁt derived when last job terminates at time
i. Then T [i] = maxj {pj + T [i − tj ]} for j such that dj ≤ i. Hence
computation of every T [i] requires O(n) time, we need to do this up to
O(n2 ) times, hence overall complexity is O(n3 ).
2. (10 points)
Let N (i) be an optimal number of coins needed to solve coinchanging
problem. Then N (i) = 1 + minj {N (i − Aj )}. Hence computation of every
N (i) requires O(n) time. We need to compute C such values, hence overall
time is O(nC ). 1 ...
View
Full
Document
This note was uploaded on 11/30/2011 for the course COT 5405 taught by Professor Ungor during the Fall '08 term at University of Florida.
 Fall '08
 UNGOR
 Algorithms

Click to edit the document details