static int knapSack(int W, int wt[], int val[], int n) ...
return dp[i][w] = recursion(n, w, val, wt, i + 1, dp); return dp[i][w] = Math.max(val[i] + recursion(n, w - wt[i], val, wt, i, dp), recursion(n, w, val, wt, i + 1, dp)); ...