The Computer Journal Advance Access originally published online on March 7, 2006
The Computer Journal 2006 49(3):351-357; doi:10.1093/comjnl/bxk003
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Skarbek's Algorithm for t-Ary Trees
Department of Computer and Information Sciences, Temple University Philadelphia, PA, USA
Corresponding author: korsh{at}temple.edu
This paper presents a new algorithm for generating all n node t-ary trees in linked representation by providing a context and generalizing Skarbek's algorithm for generating binary trees. It initially appeared that Skarbek's algorithm could not be generalized to even 3-ary trees, which motivated the author to previously develop an algorithm for generating all n node t-ary trees in linked representation based on a particular listing of integer sequences representing the trees. The context for the generalization of Skarbek's algorithm turns out to also be a particular listing of integer sequences representing the trees. The paper also gives two constant average time implementations. The first generates the next tree from its predecessor given in linked representation while the second retains additional information about the predecessor beyond just its linked representation.
Key Words: combinatorial generation t-ary trees constant average time