Index
Problem list
String
Binary string
References
TODO list
P354
: Enumeration of all bitstrings of length $n$ that contains exactly $k$ 1's
P354
:
Enumeration of all bitstrings of length $n$ that contains exactly $k$ 1's
Input:
An even integer $n$ and odd integer $k$.
Output:
All bitstrings of length $n$ that contains exactly $k$ 1's.
Complexity:
$O(1)$ amortized time per solution.
Comment:
Reference:
[
Ruskey1988
] (
Bibtex
)