Abstract
Let T(n) denote the set of all bitstrings with n 1's and n 0's such that in every prefix the number of 0's does not exceed the number of 1's. This is a well known representation of binary trees. We consider algorithms that generate the elements of T(n) in such way that successive bitstrings differ by the transposition of two bits. The presented algorithms have a constant average time per generated tree.
Partially supported by the Office of Naval research under contract N-00014-860419.
Research supported by the Natural Sciences and Engineering Research Council of Canada under grant A3379.
Preview
Unable to display preview. Download preview PDF.
References
J.R. Bitner, G. Ehrlich, and E.M. Reingold. Efficient generation of the binary reflected gray code and its applications. Comm. ACM, 19:517–521, 1976.
M. Buck and D. Wiedemann. Gray codes with restricted density. Discrete Math., 48:163–171, 1984.
P. Eades, M. Hickey, and R.C. Read. Some Hamilton paths and a minimal change algorithm. JACM, 31:19–29, 1984.
J.T. Joichi, D.E. White, and S.G. Williamson. Combinatorial gray codes. SIAM J. Computing, 9:130–141, 1980.
C.C. Lee, D.T. Lee, and C.K. Wong. Generating binary trees of bounded height. Acta Informatica, 23:529–544, 1986.
L. Li. Ranking and unranking of AVL trees. SIAM J. Computing, 15:1025–1035, 1986.
J. Lucas. The Rotation Graph of Binary Trees is Hamiltonian. Technical Report TR-021, Princeton U., 1986.
J. Pallo. Enumerating, ranking, and unranking binary trees. Computer J., 29:171–175, 1986.
A. Proskurowski. On the generation of binary trees. JACM, 27:1–2, 1980.
A. Proskurowski. Research problem 88. Discrete Math., 35:321–322, 1987.
A. Proskurowski and F. Ruskey. Binary tree gray codes. J. Algorithms, 6:225–238, 1985.
E.M. Reingold, J. Nievergelt, and N. Deo. Combinatorial Algorithms: Theory and Practice. Prentice-Hall, 1977.
D. Rotem and Y. Varol. Generation of binary trees from ballot sequences. J.ACM, 25:396–404, 1978.
F. Ruskey. Adjacent interchange generation of combinations. J. Algorithms, to appear.
F. Ruskey and T.C. Hu. Generating binary trees lexicographically. SIAM J. Computing, 6:745–758, 1977.
F. Ruskey and D.J. Miller. Adjacent Interchange Generation of Combinations and Trees. Technical Report DCS-44-IR, U. Victoria, 1984.
F. Ruskey and A. Proskurowski. Generating Binary Trees by Transpositions. Technical Report DCS-44-IR, U. Victoria, 1987.
D. Roelants van Baronaigien and F. Ruskey. A Hamilton path in the rotation lattice of binary trees. Congressus Numerantium, 1987 (to appear).
S. Zaks. Lexicographic generation of ordered trees. Theoretical Computer Science, 10:63–82, 1980.
D. Zerling. Generating binary trees using rotations. JACM, 32:694–701, 1985.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1988 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Proskurowski, A., Ruskey, F. (1988). Generating binary trees by transpositions. In: Karlsson, R., Lingas, A. (eds) SWAT 88. SWAT 1988. Lecture Notes in Computer Science, vol 318. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-19487-8_22
Download citation
DOI: https://doi.org/10.1007/3-540-19487-8_22
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-19487-3
Online ISBN: 978-3-540-39288-0
eBook Packages: Springer Book Archive