Fast powerset function

Paul Rubin http
Fri Jul 13 05:25:59 EDT 2007


Antoon Pardon <apardon at forel.vub.ac.be> writes:
> On 7/12/07, Arash Arfaee <Arash at ece.ucsb.edu> wrote:
> > I need a powerset generator function. It's really slow with recursion. Does
> > anybody have any idea or code(!!) to do it in an acceptable time?
> My idea would be the following. ...
> 3) let n range from 0 to 2 ** lng

That may help a little but my guess is the slowness comes from
the size (2**n) of the power set.



More information about the Python-list mailing list