P159: Enumeration of all partition of $\{1, \dots, n\}$ into $k$ non-empty subsets

P159: Enumeration of all partition of $\{1, \dots, n\}$ into $k$ non-empty subsets
Input:
An integer $k$.
Output:
All partition of $\{1, \dots, n\}$ into $k$ non-empty subsets.
Complexity:
$O(1)$ time per solution.
Comment:
The number of such partitions is known as the Stirling number of the second kind.
Reference:
[Kawano2005b] (Bibtex)