public class CombinationUtils extends Object
| Constructor and Description |
|---|
CombinationUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
binominal(int n,
int k)
Calculates @{code factorial(n) / (factorial(k) * factorial(n - k))}.
|
static int |
combinations(int n) |
static <T> Iterable<Pair<T>> |
combinations(List<T> list) |
static <T> List<Pair<T>> |
combinationsAsList(List<T> list) |
static int |
combinationsSorted(int n) |
static <T> Iterable<Pair<T>> |
combinationsSorted(List<T> list) |
static <T> List<Pair<T>> |
combinationsSortedAsList(List<T> list) |
static int |
factorial(int n) |
static List<Integer> |
indexes(int size) |
public static int combinations(int n)
public static int combinationsSorted(int n)
public static int binominal(int n,
int k)
n - number of different valuesk - number of slotspublic static int factorial(int n)
Copyright © 2017–2025 Hans Jörg Heßmann. All rights reserved.