Subset Sum–Dynamic Programming
Discover the different techniques used to solve the subset sum problem efficiently.
We'll cover the following...
Dynamic programming algorithm for subset sum
Recall that the subset sum problem asks whether any subset of a given array of positive integers sums to a given integer . In the previous lesson, we developed a recursive subset sum algorithm that can be reformulated as follows. Fix the original input array and define the boolean function
We need to compute . This function satisfies the following recurrence:
...