-
Notifications
You must be signed in to change notification settings - Fork 1
Home
dakusui edited this page May 20, 2013
·
12 revisions
Welcome to the enumerator wiki!
"Enumerator" is a Java library which allows you to enumerate permutations, combinations, and repeated combinations of a set that you give it to in a pretty natural Java manner like below,
List<String> list = new LinkedList<String>();
list.add("Alice");
list.add("Beth");
list.add("Christopher");
list.add("Derek");
Enumerator<String> permutator = new Permutator<String>(list, 2);
while (permutations.hasNext()) {
System.out.println(permutator.next());
}
This program will print
[Alice, Beth]
[Alice, Christopher]
[Alice, Derek]
[Beth, Alice]
[Beth, Christopher]
[Beth, Derek]
[Christopher, Alice]
[Christopher, Beth]
[Christopher, Derek]
[Derek, Alice]
[Derek, Beth]
[Derek, Christopher]