Knapsack Problem

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.

Thank you guys.
why is size_of_subset a reference man?
Can you show us more of the problem? If you need to send files, email me at: sparkprogrammer@gmail.com There's really not much to go on right now :/

Thanks,
Joe
Topic archived. No new replies allowed.