why have we initialised dp array with infinte value and dp[1][0] with 0 value
Initialisation of dp array
Minimum value of knapsack is 0 since no weight is added. Hence dp[1][0]=0.
and why infinity is assigned to other values while in previous knapsack logic we assigned value 0