CS6363: Computer Algorithms Spring 2008 Assignment 3 Due: Monday, February 11 (in class) 1. Consider the two-assembly-line scheduling problem in Chapter 15. Suppose we are given an integer k that specifies the maximum number of times a job may switch lines. Design an efficient dynamic programming algorithm that finds the fastest way through the factory among schedules that change lines at most k times. Show the recursive formulation, the resulting dynamic program and its running time analysis. 2. In solving a problem, we got the following recurrence: f(i,j) = max[0, max{1+f(i,k)+f(k,j)}, over i v) then v := x } } return v } } Write a dynamic programming algorithm that computes f(i,j), for all 1 <= i <= j <= n. What is its running time? 3. A sequence is called "alternating" if it alternates between odd and even integers (i.e., for any two successive elements, one must be odd and the other even). Give an O(n^2)-time algorithm to find the longest monotonically increasing alternating subsequence of a sequence of n numbers. 4. Problem 15-2 (p. 364) [1st ed: Prob 16-2, p. 325] (Printing neatly).