P389: Enumeration of all $t$-ary trees with fixed number leaves in lexicographically

P389: Enumeration of all $t$-ary trees with fixed number leaves in lexicographically
Input:
An integer $n$.
Output:
All $t$-ary trees with $n$ leaves in lexicographically.
Complexity:
$O(t)$ time per binary tree.
Comment:
Reference:
[Ruskey1978a] (Bibtex)