How can I maximally partition a set?

后端 未结 6 1238
既然无缘
既然无缘 2021-01-03 14:17

I\'m trying to solve one of the Project Euler problems. As a consequence, I need an algorithm that will help me find all possible partitions of a set, in any order.

6条回答
  •  [愿得一人]
    2021-01-03 15:09

    Have you considered a search tree? Each node would represent a choice of where to put an element and the leaf nodes are answers. I won't give you code because that's part of the fun of Project Euler ;)

提交回复
热议问题