Generating binary trees by transpositions

  • Andrzej Proskurowski
  • Frank Ruskey
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 318)


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.


Binary Tree Hamilton Path Gray Code Classic Convolution Constant Average Time 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    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.Google Scholar
  2. [2]
    M. Buck and D. Wiedemann. Gray codes with restricted density. Discrete Math., 48:163–171, 1984.Google Scholar
  3. [3]
    P. Eades, M. Hickey, and R.C. Read. Some Hamilton paths and a minimal change algorithm. JACM, 31:19–29, 1984.Google Scholar
  4. [4]
    J.T. Joichi, D.E. White, and S.G. Williamson. Combinatorial gray codes. SIAM J. Computing, 9:130–141, 1980.Google Scholar
  5. [5]
    C.C. Lee, D.T. Lee, and C.K. Wong. Generating binary trees of bounded height. Acta Informatica, 23:529–544, 1986.Google Scholar
  6. [6]
    L. Li. Ranking and unranking of AVL trees. SIAM J. Computing, 15:1025–1035, 1986.Google Scholar
  7. [7]
    J. Lucas. The Rotation Graph of Binary Trees is Hamiltonian. Technical Report TR-021, Princeton U., 1986.Google Scholar
  8. [8]
    J. Pallo. Enumerating, ranking, and unranking binary trees. Computer J., 29:171–175, 1986.Google Scholar
  9. [9]
    A. Proskurowski. On the generation of binary trees. JACM, 27:1–2, 1980.Google Scholar
  10. [10]
    A. Proskurowski. Research problem 88. Discrete Math., 35:321–322, 1987.Google Scholar
  11. [11]
    A. Proskurowski and F. Ruskey. Binary tree gray codes. J. Algorithms, 6:225–238, 1985.Google Scholar
  12. [12]
    E.M. Reingold, J. Nievergelt, and N. Deo. Combinatorial Algorithms: Theory and Practice. Prentice-Hall, 1977.Google Scholar
  13. [13]
    D. Rotem and Y. Varol. Generation of binary trees from ballot sequences. J.ACM, 25:396–404, 1978.Google Scholar
  14. [14]
    F. Ruskey. Adjacent interchange generation of combinations. J. Algorithms, to appear.Google Scholar
  15. [15]
    F. Ruskey and T.C. Hu. Generating binary trees lexicographically. SIAM J. Computing, 6:745–758, 1977.Google Scholar
  16. [16]
    F. Ruskey and D.J. Miller. Adjacent Interchange Generation of Combinations and Trees. Technical Report DCS-44-IR, U. Victoria, 1984.Google Scholar
  17. [17]
    F. Ruskey and A. Proskurowski. Generating Binary Trees by Transpositions. Technical Report DCS-44-IR, U. Victoria, 1987.Google Scholar
  18. [18]
    D. Roelants van Baronaigien and F. Ruskey. A Hamilton path in the rotation lattice of binary trees. Congressus Numerantium, 1987 (to appear).Google Scholar
  19. [19]
    S. Zaks. Lexicographic generation of ordered trees. Theoretical Computer Science, 10:63–82, 1980.Google Scholar
  20. [20]
    D. Zerling. Generating binary trees using rotations. JACM, 32:694–701, 1985.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1988

Authors and Affiliations

  • Andrzej Proskurowski
    • 1
  • Frank Ruskey
    • 2
  1. 1.University of OregonEugeneUSA
  2. 2.University of VictoriaCanada

Personalised recommendations