recursively find subsets

后端 未结 4 1188
没有蜡笔的小新
没有蜡笔的小新 2021-01-26 10:37

Here is a recursive function that I\'m trying to create that finds all the subsets passed in an STL set. the two params are an STL set to search for subjects, and a number i >=

4条回答
  •  执念已碎
    2021-01-26 11:26

    It seems (I'm not native English) that what you could do is to compute power set (set of all subsets) and then select only subsets matching condition from it.

    You can find methods how to calculate power set on Wikipedia Power set page and on Math Is Fun (link is in External links section on that Wikipedia page named Power Set from Math Is Fun and I cannot post it here directly because spam prevention mechanism). On math is fun mainly section It's binary.

提交回复
热议问题