Update knapsack.java