knapsak Problem Please Help
Java Code , Please Help
HELP
i just want to add a small edit : we have another limitation:the number of items may be a given k∈ N do not exceed!
Here is my Code :
in my Code there is a problem :
Profit is not optimal (the output should be :100 ,expected: 100,produced: 74)
but i become 74
can you Help me please
public class Knapsack {
public static int pack(Itema[] items, int capacity,int maxItems) {
int K[][] = new int[maxItems + 1][capacity + 1];
for (int i = 0; i<= maxItems; i++) {
for (int w = 0; w<= capacity; w++) {
PayPal Gateway not configured
PayPal Gateway not configured