Give the algorithm to decide if a list of integers can be divided into two smaller lists of
equal sum. For example,
[10, 20 , 30 , 5 , 40 , 50 , 40 , 15]
can be fairly divided into
[10, 20, 30, 5, 40] and [50, 40, 15]
However,
[4, 4, 8, 10,14] cannot be divided.
1
Expert's answer
2015-11-10T09:22:24-0500
It is a subset sum problem. See https://www.geeksforgeeks.org/dynamic-programming-subset-sum-problem/ and pseudocode https://en.wikipedia.org/wiki/Subset_sum_problem
Comments
Leave a comment