Hi. I am a beginner to C++ programming and i am finding difficulty in writing program for knapsack problem. Please help me out with this coding part.
I have a piece of inputs. They are:
int knapsack(int *a //the input integers
int n, //the number of input integers
int s, // knapsack size
int *subset, //subset of elements
int &size_of_subset //the number of items in the subset
)
Program for a subset with the sum of its elements so that the sum has the closest distance of 595.