Combinations

Given non-negative integers m and n, generate all size m combinations of the integers from 0 to n-1 in sorted order (each combination is sorted and the entire table is sorted).

For example, 3 comb 5 is 0 1 2 0 1 3 0 1 4 0 2 3 0 2 4 0 3 4 1 2 3 1 2 4 1 3 4 2 3 4

struct Combinations (
T
bool copy = true
bool useArray = true
) {
Unqual!T[] pool;
Unqual!T[] front;
size_t r;
size_t n;
bool empty;
Indices indices;
size_t len;
bool lenComputed;
}

See Also

Meta