Knapsack packing problem in Java w/out memoization