I am working on this study guide question and really don’t understand how to do this, so I am hoping someone could help me. Here is the question:
You are given the table of values table[rows][cols] and an integer N. You can take as many of the values as you want from the top of each column, but you may take no more than a total of N values (N=4). Your goal is to maximize the sum of your values. Show a dynamic programming table to solve this problem for the specific instance given below. Fill in the numbers in your entire table. (The “answer” is 47)
Table:
10 6 2 13
4 18 22 13
15 5 14 2
Thanks a ton for any help!
I don’t really know what to put in this section as to what I tried since I was sort of flailing about lol. I know it involves adding some values in the table together, but I am confused about the directional choices (my teacher’s example moves down and to the right) involved in these types of problems.
mazemasta77 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1