Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update Minimum sum partition
Added some test cases for better understanding.
  • Loading branch information
swatiprajapati08 authored Jun 3, 2020
commit 5d771745ac57c89c93e8dd9231f1d67fd1cea255
14 changes: 14 additions & 0 deletions DynamicProgramming/Minimum sum partition
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
// Partition a set into two subsets such that the difference of subset sums is minimum

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly provide some sample test cases

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

/*
Input: arr[] = {1, 6, 11, 5}
Output: 1
Explanation:
Subset1 = {1, 5, 6}, sum of Subset1 = 12
Subset2 = {11}, sum of Subset2 = 11

Input: arr[] = {36, 7, 46, 40}
Output: 23
Explanation:
Subset1 = {7, 46} ; sum of Subset1 = 53
Subset2 = {36, 40} ; sum of Subset2 = 76
*/

import java.util.*;
import java.lang.*;
import java.io.*;
Expand Down