Send to a Friend
How can I write a program to generate all partitions of a set?
Asked by PrettyDepressed (12)
December 4th, 2010
from iPhone
I’m writing a program that does a whole bunch of set theory stuff to make my life easier, and I want it to generate all subsets of a list of elements. I’m looking for some kind of recursive solution…one that could ideally be contained in a single function or something. I know I’m like right on top of a solution, but for some reason I just can’t seem to carry it out.
For reference: http://en.wikipedia.org/wiki/Partition_of_a_set
Using Fluther
or