Welcome back.
Let's now discuss the pseudocode for the memoization approach that we have just now discussed for solving
the zero one knapsack problem.
Now we have this table over here.
And initially we filled all the cells over here with the value minus one.
So whenever we encounter a recursive call to the knapsack function first we will check whether depee
at item and w is not equal to minus one.
Because if it's not minus one, it means that we had previously computed it and stored it, and we would
just return the value at that particular cell.
Now, if it is equal to minus one, it would mean that we have not yet encountered this subproblem,
and therefore we would proceed and compute the value.
And before we return the value, we would ensure to store it at depee at item and w.
So this is the approach that we will be taking to implement the code of the approach that we have discussed.