TimurMahammadov / google-collections

Automatically exported from code.google.com/p/google-collections
Apache License 2.0
0 stars 0 forks source link

Permutations of a list #71

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Add a method in Lists:

<T> Iterable<List<T>> permutate(List<T> list);

Which would enumerate all permutations of a list (as lists themselves). 

See:
http://en.wikipedia.org/wiki/Permutation
for the algorithm creating permutations on-the-fly.

This is useful in testing; creating all permutations of test input data for
example.

Original issue reported on code.google.com by jim.andreou on 6 Jun 2008 at 2:49

GoogleCodeExporter commented 9 years ago
Here is my suggestion for implementation. The base code was taken from 
somewhere on
the web (I don't really remember), and I generified it.

Original comment by boaz...@gmail.com on 13 Jul 2008 at 6:52

Attachments:

GoogleCodeExporter commented 9 years ago
Requires RandomAccess list and violently explodes if given anything else.

Original comment by earwin@gmail.com on 13 Jul 2008 at 7:18

GoogleCodeExporter commented 9 years ago

Original comment by kevin...@gmail.com on 17 Sep 2009 at 5:57

GoogleCodeExporter commented 9 years ago

Original comment by kevin...@gmail.com on 17 Sep 2009 at 6:02

GoogleCodeExporter commented 9 years ago
This issue has been moved to the Guava project (keeping the same id number). 
Simply replace 'google-collections' with 'guava-libraries' in your address 
bar and it should take you there.

Original comment by kevinb@google.com on 5 Jan 2010 at 11:09