Generate all partitions of integer array

385 Views Asked by At

The Bell numbers count the number of partitions of a set. I want to generate all possible partitions of my integer array.

For example, I have the following integer array: {1, 2, 3, 4}. Then there are 15 partitions.

all partitions

Is there any simple way to complete my task? Or what is common algorithm?

0

There are 0 best solutions below