This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Home
jcombinatorics is a library written in Java that provides permutations and combinations generators and utility functions.
Generating Permutations
for (int[] permutation : Permutations.of(2, 3, 7)) {
System.out.println(Arrays.toString(permutation));
}
Outputs:
[2, 3, 7]
[2, 7, 3]
[3, 2, 7]
[3, 7, 2]
[7, 2, 3]
[7, 3, 2]
for (int[] permutation : Permutations.of(2, 3, 7)) {
System.out.println(Arrays.toString(permutation));
} [2, 3, 7]
[2, 7, 3]
[3, 2, 7]
[3, 7, 2]
[7, 2, 3]
[7, 3, 2]Generating Combinations
for (String[] combination : Combinations.of("a", "b", "c", "d", "e").take(3)) {
System.out.println(Arrays.toString(combination));
}
Outputs:
[a, b, c]
[a, b, d]
[a, b, e]
[a, c, d]
[a, c, e]
[a, d, e]
[b, c, d]
[b, c, e]
[b, d, e]
[c, d, e]
for (String[] combination : Combinations.of("a", "b", "c", "d", "e").take(3)) {
System.out.println(Arrays.toString(combination));
} [a, b, c]
[a, b, d]
[a, b, e]
[a, c, d]
[a, c, e]
[a, d, e]
[b, c, d]
[b, c, e]
[b, d, e]
[c, d, e]





