You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.
Note:
1. Each of the array element will not exceed 100.
2. The array size will not exceed 200.
*/
package partitionequalsubsetsum
/*
此问题可以使用0-1背包问题的思路求解
c是数组和的一半。
状态定义:F(n c)
状态转移方程:F(n c) = max( F(n-1, c) , n + F(n-1, c-n) )