
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Professor: Bai; Class: Algorithm Design; Subject: Engineering Computer Science; University: University of California - Davis; Term: Spring 2009;
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

ECS122A: Algorithm Design and Analysis Due: 4:00pm, Thursday, April 30, 2009 Homework Assignment #
a =
[ 4 6 5 8 2 4 8 3 4 6 4 7
] , t =
[ 3 2 1 2 1 1 3 2 3 1
]
and e =
[ 4 2
] , x =
[ 1 3
] .
Determine what stations should be chosen from line 1 and from line 2 in order to minimize the total time through the factory.
(a) Give a dynamic programming algorithm to find the maximum common substring length for X and Y. (b) Analyze the worst-case running time and space requirements of your algorithm as functions of n and m. (c) Demonstrate your dynamic programming algorithm for finding the maximum common sub- string length of character strings (c.1) photograph and tomography (c.2) cabccb and babcba. by construct a dynamic programming table similar to Figure 15.5 of CLRS on page 354.
Given an integer A, what is the minimum number of coins needed to make A cents in change?
(a) Under what condition(s) on the denominations di are you able to make change for any amount A? (b) Give a dynamic programming algorithm to solve the problem. (c) How fast is your algorithm?