F dividing a set of into two subsets such that the difference between the sum of sets is minimum
Answers
Answered by
0
Answer:
Step-by-step explanation:
If there is a set S with n elements, then if we assume Subset1 has m elements, Subset2 must have n-m elements and the value of abs(sum(Subset1) – sum(Subset2)) should be minimum.
Example:
Input: arr[] = {1, 6, 11, 5}
Output: 1
Explanation:
Subset1 = {1, 5, 6}, sum of Subset1 = 12
Subset2 = {11}, sum of Subset2 = 11
Hope it helps you...
Similar questions
English,
6 months ago
Accountancy,
6 months ago
Accountancy,
6 months ago
Physics,
1 year ago
Math,
1 year ago
Math,
1 year ago
Biology,
1 year ago
Social Sciences,
1 year ago