recursively find subsets

后端 未结 4 1185
没有蜡笔的小新
没有蜡笔的小新 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:18

    I have been staring at this for several minutes and I can't figure out what your train of thought is for thinking that it would work. You are permanently removing several members of the input list before exploring every possible subset that they could participate in.

    Try working out the solution you intend in pseudo-code and see if you can see the problem without the stl interfering.

提交回复
热议问题