P388: Enumeration of all binary trees with fixed number leaves in lexicographically

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