Skip to content
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]
Clone this wiki locally