Question: JAVA/C++ Algorithum Write a program that solves the Subset Sum Problem for the following sets: Set A: {-7, -3, -2, 5, 8} Set B: {6,

JAVA/C++ Algorithum

Write a program that solves the Subset Sum Problem for the following sets:

Set A: {-7, -3, -2, 5, 8}

Set B: {6, 5, 3, 1, 8, 7, 2, 4, -2, -3}

For each set, record the start time and end time for the solution.

Modify your program to solve the Subset Sum Problem for Set C that includes a random number of integers (20 >= n <= 100), with each value ranging from -10 to 10. In other words, the size of the set will be a random number from 20 to 100 inclusive, with each element in the set being a random number from -10 to 10 inclusive.

Run the Subset Sum Problem 3 times for Set C and record the start and end time for the solution.

Note: Your code may not halt (i.e., welcome to the Halting Problem), so you should have a mechanism to end your code when this occurs.

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!