Pulling all n-sized combinations from a list

my.correo.basura at gmail.com my.correo.basura at gmail.com
Wed Feb 8 18:34:54 EST 2006


> Ah, this definitely seems to work!  It's a lot nicer in appearance than
> my previous code, that's for sure.  It actually runs in approximately
> the same amount of time though.

As a side note, this problem will always be "slow". The number of
combinations grows exponentially with n. No matter how fast you
generate a combination, generating them all it's going to take a lot of
time if n is slighty bigger.




More information about the Python-list mailing list