Skip to main content

A Loopless Algorithm for Generating Multiple Binary Tree Sequences Simultaneously

  • Conference paper
Combinatorial Optimization and Applications (COCOA 2013)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 8287))

  • 1170 Accesses

Abstract

Pallo and Wu et al. respectively introduced the left-weight sequences (LW-sequences) and right-weight sequences (RW-sequences) for representing binary trees. In this paper, we introduce two new types of binary tree sequences called the left-child sequences (LC-sequences) and right-child sequences (RC-sequences). Next, we propose a loopless algorithm associated with rotations of binary trees for generating LW-, RW-, LC-, and RC-sequences simultaneously. Moreover, we show that LW- and RW-sequences are generated in Gray-code order, and LC- and RC-sequences are generated so that each sequence can be obtained from its predecessor by changing at most two digits. Our algorithm is shown to be more efficient in both space and time than the existing known algorithms.

This work was partially supported by the National Science Council of Taiwan under contracts NSC102-2221-E-262-013 and NSC102-2221-E-141-001-MY3.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ehrlich, G.: Loopless algorithms for generating permutations, combinations, and other combinatorial configurations. J. ACM 20, 500–513 (1973)

    Article  MathSciNet  MATH  Google Scholar 

  2. Korsh, J.F.: Loopless generation of k-ary tree sequences. Inform. Process. Lett. 52, 243–247 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  3. Korsh, J.F., LaFollette, P.: Loopless generation of Gray codes for k-ary trees. Inform. Process. Lett. 70, 7–11 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  4. Korsh, J.F., Lipschutz, S.: Shift and loopless generation of k-ary trees. Inform. Process. Lett. 65, 235–240 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  5. Knuth, D.E.: The Art of Computer Programming. Fascicle 4A — Generating All Trees, vol. 4. Addison-Wesley (2005)

    Google Scholar 

  6. Lucas, J.M., Roelants van Baronaigien, D., Ruskey, F.: On rotations and the generation of binary trees. J. Algorithms 15, 343–366 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  7. Pallo, J.: Enumerating, ranking and unranking binary trees. Comput. J. 29, 171–175 (1986)

    Article  MathSciNet  MATH  Google Scholar 

  8. Roelants van Baronaigien, D.: A loopless algorithm for generating binary tree sequences. Inform. Process. Lett. 39, 189–194 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  9. Roelants van Baronaigien, D.: A loopless Gray-code algorithm for listing k-ary trees. J. Algorithms 35, 100–107 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  10. Roelants van Baronaigien, D., Ruskey, F.: A Hamiltonian path in the rotation lattice of binary trees. Congr. Numer. 59, 313–318 (1987)

    MathSciNet  MATH  Google Scholar 

  11. Takaoka, T.: O(1) time algorithms for combinatorial generation by tree traversal. Comput. J. 42, 400–408 (1999)

    Article  MATH  Google Scholar 

  12. Vajnovszki, V.: On the loopless generation of binary tree sequences. Inform. Process. Lett. 68, 113–117 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  13. Vajnovszki, V.: Generating a Gray code for P-sequences. J. Math. Model. Algorithms 1, 31–41 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  14. Williamson, S.G.: Combinatorics for Computer Science. Computer Science Press, Rockville (1985)

    MATH  Google Scholar 

  15. Wu, R.-Y., Chang, J.-M., Wang, Y.-L.: A linear time algorithm for binary tree sequences transformation using left-arm and right-arm rotations. Theor. Comput. Sci. 355, 303–314 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  16. Wu, R.-Y., Chang, J.-M., Wang, Y.-L.: Loopless Generation of non-regular trees with a prescribed branching sequence. Comput. J. 53, 661–666 (2010)

    Article  Google Scholar 

  17. Xiang, L., Ushijima, K.: On O(1) time algorithms for combinatorial generation. Comput. J. 44, 292–302 (2001)

    Article  MATH  Google Scholar 

  18. Xiang, L., Ushijima, K., Tang, C.: Efficient loopless generation of Gray codes for k-ary trees. Inform. Process. Lett. 76, 169–174 (2000)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer International Publishing Switzerland

About this paper

Cite this paper

Wu, RY., Chang, JM., Chan, HC., Pai, KJ. (2013). A Loopless Algorithm for Generating Multiple Binary Tree Sequences Simultaneously. In: Widmayer, P., Xu, Y., Zhu, B. (eds) Combinatorial Optimization and Applications. COCOA 2013. Lecture Notes in Computer Science, vol 8287. Springer, Cham. https://doi.org/10.1007/978-3-319-03780-6_30

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-03780-6_30

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-03779-0

  • Online ISBN: 978-3-319-03780-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics