File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Equal Sum Partition problem
2+
3+
4+
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.
5+
Examples:
6+
7+
arr[] = {1, 5, 11, 5}
8+
Output: true
9+
The array can be partitioned as {1, 5, 5} and {11}
10+
11+
arr[] = {1, 5, 3}
12+
Output: false
13+
The array cannot be partitioned into equal sum sets.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Subset Sum Problem:
2+
3+
Given a set of non-negative integers, and a value sum, determine if there is a subset of the given set with sum equal to given sum.
4+
Example:
5+
6+
Input: set[] = {3, 34, 4, 12, 5, 2}, sum = 9
7+
Output: True
8+
There is a subset (4, 5) with sum 9.
9+
10+
Input: set[] = {3, 34, 4, 12, 5, 2}, sum = 30
11+
Output: False
12+
There is no subset that add up to 30.

0 commit comments

Comments
 (0)