Consider below inputs for typical Knapsack problem.
V = [10,8,12]
W = [2,3,7]
i = 1,2,3
C = 10
I tried recursion with memoization to solve this sample but found no overlapping sub problem.
Signature of the recursive procedure :
knapsack(int c, int i)
Called initially as knapsack(10,1)
The method of the solution is like as explained in https://www.youtube.com/watch?v=6h6Fi6AQiRM and https://www.youtube.com/watch?v=ocZMDMZwhCY.
How does Dynamic programming helps in reducing the time complexity for such samples of Knapsack ? If it does not help improving the time complexity of this case then does worst case complexity of DP solution also same as of back track search based i.e. 2 to the power n [ignoring the pruning, as if pruning applied then complexity will reduce for both the solution and again DP will not be better than non memoized recursive solution]
** Is overlapping in sub problems really missing in the above sample or I am missing something ?**