Your cart is currently empty!
Goals: Understanding of dynamic programming. Understanding of subset sums. Requirements: Design, code, and test a C program to compute subset sums for all possible cardinalities. The input is to be read from standard input (which will be one of: a. keyboard typing, b. a shell redirect (<) from a file,…
Goals:
Requirements:
The input is to be read from standard input (which will be one of: a. keyboard typing, b. a shell redirect (<) from a file, or c. cut-and-paste. Do NOT prompt for a file name!). The first input line will have n, the number of positive integer values appearing on the subsequent lines, and m, the target value. Each of the remaining input lines will include one of the m sequence values (unordered).
The output is to include: a. the input, appropriately labeled, b. the dynamic programming table, and c. backtrace for a computed solution for every subset cardinality that has a solution.
Getting Started:
7 25
1
3
4
6
7
10
25
There would be solutions of cardinality 1: { 25 } and 5: { 1 3 4 7 10 }.