© 2002 by British Computer Society
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Loopless Generation of Trees with Specified Degrees
1 Department of Computer and Information Sciences, Temple University, Philadelphia, PA 19122, USA Email: korsch@temple.edu
An ordered tree with specified degrees and $n$ nodes has $a_{i}$ nodes of degree $i$ where $a_{0} = 1+\sum _{i = 1,h}(i-1)a_{i}$ and $n = \sum_{i = 0,h}a_{i}$. This paper presents a new and simpler loopless algorithm for generating all ordered trees with specified degrees. When $a_{k} = N$, $a_{0} = (k-1)N+1$ and all other $a_{i}$'s are 0, then all $N$ node $k$-ary trees are generated.