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

Let A be an array of integers , sorted in increasing order….

Let A be an array of integers , sorted in increasing order. A shift of A by k, denoted by , means removing the last k elements and placing them at the beginning. For example, if A= {1, 2, 3, 4, 5, 6, 7} and k = 3, then  = {5, 6, 7, 1, 2, 3, 4}. Design a divide and conquer algorithm that takes as input a sorted array A that has been shifted by an unknown 0