Talk:Power set: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
(Ada solution bug fixed)
Line 9: Line 9:
* A,E
* A,E
* A,C
* A,C

: This is fixed. --[[User:Dmitry-kazakov|Dmitry-kazakov]] 18:22, 14 October 2008 (UTC)

Revision as of 18:22, 14 October 2008

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)

This is what your Ada code gives:

  • A
  • C
  • E
  • A
  • A,C
  • A,E
  • A,C
This is fixed. --Dmitry-kazakov 18:22, 14 October 2008 (UTC)