Let A be an array of letters of the English alphabet. Recall…

Let A be an array of letters of the English alphabet. Recall that a subarray of A is of the form A, A,…, A. An array is palindromic if it is the same whether read left to right or right to left. Design a Dynamic Programming algorithm that takes as input an array A and returns the Longest Palindromic Subarray.  Example: A=, your algorithm should return the subarray from index 3 to 9, namely .   Please answer the following parts: Define the entries of your table in words. E.g. T(i) or T(i, j) is … State a recurrence for the entries of your table in terms of smaller subproblems.  Don’t forget your base case(s). Analyze an implementation of this recurrence:         A. State the number of subproblems in big-O notation.         B. State the runtime to fill your table using your recurrence from part 2.         C. State how the return is extracted from your table.          D. State the runtime of that return extraction.

Raquel is going on a really long trip, and will need many to…

Raquel is going on a really long trip, and will need many toys to be entertained. Prof. Brito allows her to use two bags, with capacities respectively. Design a Dynamic Programming algorithm for Raquel such that: given an array W and L for toys numbered , where W is the weight of toy i, and L is the liking coefficient for each toy (the higher L, the more she likes toy i), your algorithm outputs the maximum sum of the L values of both bags. For now, Raquel only has 1 of each toy. Example: W=, L=, , your algorithm should return 8=5+3 as a result of placing toy 2 in the second bag, and toy 4 in the first bag. Note that you can fill the second bag with toys 1 and 4, and place toy 3 in the first bag, but the sum of the L values in this case is 2+3+1=6