Implementation of a Knapsack algorithm with 2 one-dimensional arrays instead of 1 big two-dimensional array.