Question: Consider the following problem: given n positive integers, separate them into two groups such that adding all the numbers in one group gives the same

Consider the following problem: given n positive integers, separate them into two groups such that adding all the numbers in one group gives the same result as adding all the numbers in the other group. For example, if the numbers are 1, 2, 3, 4, then the two groups could be {1, 4} and {2, 3}, which both sum to 5. For another example, if the numbers are 5, 6, 11, then the two groups could be {5, 6} and {11}. (The groups do not have to be of the same size).

(a) Describe an exhaustive search algorithm for this problem.

(b) What is the asymptotic worst-case running time of your algorithm? Justify your answer.

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 Databases Questions!