Question: struggling with the dynamic programming implementation, any help with the algorithm is much appreciated. Formal description: You are given x1,...,xin e Z, and some k,

struggling with the dynamic programming implementation, any help with the algorithm is much appreciated.
Formal description: You are given x1,...,xin e Z, and some k, L E N. You want to find a collection of intervals I1, ...,Ik CR, each of length L, such that the number of points in X1, ... , In that fall inside I1 U... U It is maximized. Describe a polynomial-time algorithm for this problem. That is, the running time of your algorithm should be at most polynomial in n. Prove that your algorithm is correct and that it runs in polynomial time. For example, if the input is x1 = 1, X2 = 3, x3 = 4, x4 = 6, X5 = 9, X6 = 10, 27 = 11, 28 = 12, X9 = 15, I 10 = 17, k = 3, and L = 3, then an optimum solution is [1,4], (9,12],[14, 17). O HHHHHHt 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Hint: Use dynamic programming
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
