© 1989 by British Computer Society
| ||||||||||||||||||||||||||||||||||||||||||||||||||
A New Algorithm for Generating Binary Trees using Rotations
Department of Computer Science, The University of Western Australia, Nedlands, WA 6009, Australia
A new formulation for generating all binary trees with n nodes by using tree rotations is presented. Such a new formulation is based on a detailed study of the properties of codewords with (n-1) non-negative integers that are called rotational admissible. A 1 - 1 correspondence between a set of binary trees with n nodes and a set of rotational admissible codewords with (n-1) integers is formally established. As a results, simple and efficient algorithms for generating rotational-admissible codewords and for generating binary trees using rotations are derived. An empirical test reveals that both algorithms run faster than the corresponding Zerling's algorithms for performing the same task.
Received October 1986. revised May 1987.
* Department of Computer Science, The University of Western Australia, Nedlands, WA 6009, Australia