A set X= {x1, x2, ..., xn} of positive integers is given and number S. It is required to find out whether the number S can be represented as a sum some of the numbers in the set X, if each number can be used not more than once. I’m just studying algorithms, and I got such a task, the only thing I understood was that I needed to work with the partitioning algorithm. I would be grateful for any help

we read combinatorics. we implement the classic problem of obtaining combinations without repetitions, along the way learning what recursion is. We rejoice at the knowledge gained

Sergey Tatarincev2021-11-26 23:48:12

If you've learned how to solve a problem for nine numbers, how do you solve it for ten? Is it possible to compose the second from the first solution?

Stanislav Volodarskiy2021-11-26 23:48:12

@SergeyTatarincev rejoice at 2 ^ n asymptotics, great news

Neuro2021-11-26 08:05:34