Question: 5. (25, Reductions) In the Exact-Sum problem, you are given an array A of positive integers, a number T, and you have to decide if
5. (25, Reductions) In the Exact-Sum problem, you are given an array A of positive integers, a number T, and you have to decide if there is a subset of the entries in A that sum to exactly T. For example, if the Input: A=[3,34,4,12,5,2], and T=9 then the output should be True, as there is a subset {4,5} with sum 9. On the other hand, if input A=[3,34,4,12,5,2], and T=30, the output should be False, as there is no subset that can add up to 30 . Note that this is a decision
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
