Question: Modify the algo given in Problem 1 of Problem Set 11 to solve the following (very similar) problem: We are given n different positive integers:

Modify the algo given in Problem 1 of Problem Set 11 to solve the following (very similar) problem: We are given n different positive integers: a1, a2, . . . , an and another integer b. We want to determine how many different choices we have to express b as the sum of some of the ai 's (each ai can be used at most once in the sum). Design an algo for this problem, the running time should be O(nb)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!