Talk:Power set

From Rosetta Code
Revision as of 16:59, 16 June 2008 by rosettacode>Mwn3d (The dumb answer?)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

So how about the slow approach of coming up with random combinations and adding them to a set until it has 2n elements? The set object would have to guarantee uniqueness, but it would work eventually. To save some time you could add each element in the original list and the empty set to start then add sets of size 2 to n. --Mwn3d 10:59, 16 June 2008 (MDT)