© 1985 by British Computer Society
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Enumerating Ordered Trees Lexicographically
Department of Computer Science, University of Western Australia, Nedlands, W.A. 6009, Australia
A 1-1 mapping between the set of extended ordered trees with n internal nodes and the set of feasible binary bit-patterns with 2n bits is established. By manipulating the feasible bit-patterns, the set of ordered trees with n nodes can be enumerated lexicographically. The ranking and unranking functions are also described. It has been shown that the bit-pattern representation of ordered trees leads to simple construction and easy understanding of the enumerating, ranking and unranking algorithms.
* Department of Computer Science, University of Western Australia, Nedlands, W.A. 6009, Australia