subject

Design, code, and test a C program that uses dynamic programming to determine two separate subsequences of the input such that the first subsequence sums to the first target value and the second subsequence sums to the second target value. The input should be read from standard input (which will be one of (1) keyboard typing, (2) a shell redirect (<) from a file, or (3) cut - and - paste. Do NOT prompt for a file name!
The first line of the input will give n , the length of the sequence , along with the two target values . Each of the remaining input lines will include one sequence value. All values will be positive integers. Your program should echo the target values and the input sequence. If a problem instance has a solution, each of the two subsequences should be output and clearly labeled. A message should be provided for instances without a solution.
Getting Started:
1. Unlike the one-dimensional situation for ordinary subset sums, this problem is two-dimensional.
2. Dynamic programming is the only acceptable method for doing this lab.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 04:10
2pointswho was mikhail gorbachev? oa. a russian leader who opposed a coupob. a polish leader who founded the labor union "solidarityoc. a soviet leader who called for a closer relationship with the unitedstates, economic reform, and a more open societyd. a soviet leader who called for more oppression in the soviet union
Answers: 3
question
Computers and Technology, 23.06.2019 04:31
Which of the following is not a way in which trees benefit the environment? a. they remove a significant amount of carbon dioxide from the atmosphere. b. they remove a significant amount of oxygen from the atmosphere. c. their roots hold soil in place, reducing rates of erosion. d. they remove ozone and particulates from the atmosphere. select the best answer from the choices provided a b c d
Answers: 1
question
Computers and Technology, 23.06.2019 05:20
What did creator markus “notch" persson initially call his game
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
You know the right answer?
Design, code, and test a C program that uses dynamic programming to determine two separate subsequen...
Questions
question
Physics, 04.06.2020 13:29
question
Mathematics, 04.06.2020 13:29
Questions on the website: 13722359