educative.io

Memoization Approach

In the memoization approach, the example states that the problem contains two overlapping subproblems. However, these subproblems utilize different items to determine different the corresponding profits. Namely, [A, B] for i: 3, c: 4…and [C] for i: 3, c: 4. Their corresponding profits are 7 and 10.

Additionally, the recursive approach allows us to create different combinations of items, and no branch is alike. Why then are we using memo?