I am unable to understand how this partition problem can be thought of as a dynamic programming problem.
I have the following doubts:
1) It is not an optimization problem (or I am unable to see) then why are we applying DP approach to it?
2) DP problems satisfy 2 properties:
- Overlapping Subproblems
Optimal Substructure
But I am unable to see the problem satisfying the above properties.
Partition problem is to determine whether a given set can be partitioned into two subsets such that the sum of elements in both subsets is same.
arr[] = {1, 5, 11, 5}
Output: true
The array can be partitioned as {1, 5, 5} and {11}
arr[] = {1, 5, 3}
Output: false
The array cannot be partitioned into equal sum sets.