You are working in a warehouse and want to pass the time and make the tallest tower of boxes you can. Your daily shipment of boxes includes two 1-indexed arrays, and . Array Structure is the array of box names (strings) - relatively unimportant for you, for all you care about is… is the array of weight values - is how heavy the th box will be. The array is ordered by the time in which you'll receive the box. Constraints Later items in the array must be added to your stack later than earlier items - the shipment arrays are ordered lists. You want each box on the stack to be lighter than anything it sits on top of, so you'd like to select a combination of boxes which, when stacked in array order, have strictly decreasing weight value . The order of the array cannot be changed. Goals Pick a set of boxes so that each box is lighter than the one selected before it. Pick as many boxes as possible. We will solve this with the following overlapping subproblem: Let = {the maximum number of boxes that can be stacked from the first boxes under the restrictions above, that must include using the box in particular}. Example For the following items: "Air Container", "Bulky object", "Cardboard Quadrilateral", "Delicate Item", "Empty", "Fragile Cube", "Gravel" tells us how many items can be stacked from the first 5 boxes, under the constraint that we must select box 5. (Which is 3 boxes - we could stack “Bulky Object”, “Cardboard Quadrilateral” and “Empty”.) Your task Give the recurrence relation for . Include all cases (and only those) in the expression . Ensure no cases selected overlap. Assume that the maximum/minimum of an empty set is . Multiple solutions may be possible, and multiple cases may be unnecessary but not incorrect to include. All correct approaches will achieve full marks.多项选择题

题目图片
A

a.

B

b.

C

c.

D

d.

E

e.

F

f.

G

g.

H

h.

I

i.

J

j.

K

k.

L

l.

M

m.

登录即可查看完整答案

我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。

类似问题

Pierre's microwave has keys to input reheating time, with possible positive times described by the set . For instance, we could have .Pierre is wondering what the minimum number of keys to press to input the time . Each key can be pressed multiple times.For example, the minimum number of keys to press for a time is : pressing twice and pressing five times.In order to solve this problem, we decompose the problem into subproblems defined as {the minimum number of key presses required to input a time t using keys from }.Give a recurrence relation for by giving all cases in the expression.(Recall that a recurrence relation needs at least one base case and one general case.)

Pierre's microwave has keys to input reheating time, with possible positive times described by the set . For instance, we could have .Pierre is wondering what the minimum number of keys to press to input the time . Each key can be pressed multiple times.For example, the minimum number of keys to press for a time is : pressing twice and pressing five times.In order to solve this problem, we decompose the problem into subproblems defined as {the minimum number of key presses required to input a time t using keys from }.Give a recurrence relation for by giving all cases in the expression.(Recall that a recurrence relation needs at least one base case and one general case.)

You find yourself curiously stranded on a n by n mysterious grid (shown below), unsure of how you got there, or how to leave. You denote the rows of the grid from bottom to top as 1, 2, ..., n, and similarly denote the columns from left to right as 1, 2, ..., n. Cell (i, j) refers to row i, column j.You are currently standing at the bottom-left corner of the grid and wonder to yourself how many different ways there are to walk to the top-right corner of the grid. However, there are certain conditions on the grid's cells.In the normal cells of the grid (cells with white background below), you feel fatigued and are only able to move to the cell to the immediate right (to the next column). In the special cells of the grid (cells with blue background below), you feel more energised and are able to move either to the cell that is immediately up (to the next row) or immediately right (to the next column).Which of the following options describe correct dynamic programming recurrences for those cells? Select all correct options.

Question text Using the optimal substructure stated below for a Dynamic Programming Solution to the Coin Change Problem:You are given the following input values:c = [2,3,8,7] v = 8 Complete the MinCoins array below, using numerical value (1,2,3,...) or inf[table] MinCoins[0] | MinCoins[1] | MinCoins[2] | MinCoins[3] | MinCoins[4] | MinCoins[5] | MinCoins[6] | MinCoins[7] | MinCoins[8] Answer 1 Question 1 | Answer 2 Question 1 | Answer 3 Question 1 | Answer 4 Question 1 | Answer 5 Question 1 | Answer 6 Question 1 | Answer 7 Question 1 | Answer 8 Question 1 | Answer 9 Question 1 [/table]

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!