generation permutations of a set of sets

From time to time, the idea of creating all the permutations from a set of sets or array of arrays comes up. Here is a nice simple iterative implementation. The core is createPermutations. The inputs are comma separate lists of strings.

The Javascript is commented, but I think it will make more sense once you have played with it a little bit: http://brianin3d.googlepages.com/permute.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: