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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Ehrlich, G.: Loopless algorithms for generating permutations, combinations, and other combinatorial configurations. J. ACM 20, 500–513 (1973)
Korsh, J.F.: Loopless generation of k-ary tree sequences. Inform. Process. Lett. 52, 243–247 (1994)
Korsh, J.F., LaFollette, P.: Loopless generation of Gray codes for k-ary trees. Inform. Process. Lett. 70, 7–11 (1999)
Korsh, J.F., Lipschutz, S.: Shift and loopless generation of k-ary trees. Inform. Process. Lett. 65, 235–240 (1998)
Knuth, D.E.: The Art of Computer Programming. Fascicle 4A — Generating All Trees, vol. 4. Addison-Wesley (2005)
Lucas, J.M., Roelants van Baronaigien, D., Ruskey, F.: On rotations and the generation of binary trees. J. Algorithms 15, 343–366 (1993)
Pallo, J.: Enumerating, ranking and unranking binary trees. Comput. J. 29, 171–175 (1986)
Roelants van Baronaigien, D.: A loopless algorithm for generating binary tree sequences. Inform. Process. Lett. 39, 189–194 (1991)
Roelants van Baronaigien, D.: A loopless Gray-code algorithm for listing k-ary trees. J. Algorithms 35, 100–107 (2000)
Roelants van Baronaigien, D., Ruskey, F.: A Hamiltonian path in the rotation lattice of binary trees. Congr. Numer. 59, 313–318 (1987)
Takaoka, T.: O(1) time algorithms for combinatorial generation by tree traversal. Comput. J. 42, 400–408 (1999)
Vajnovszki, V.: On the loopless generation of binary tree sequences. Inform. Process. Lett. 68, 113–117 (1998)
Vajnovszki, V.: Generating a Gray code for P-sequences. J. Math. Model. Algorithms 1, 31–41 (2002)
Williamson, S.G.: Combinatorics for Computer Science. Computer Science Press, Rockville (1985)
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)
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)
Xiang, L., Ushijima, K.: On O(1) time algorithms for combinatorial generation. Comput. J. 44, 292–302 (2001)
Xiang, L., Ushijima, K., Tang, C.: Efficient loopless generation of Gray codes for k-ary trees. Inform. Process. Lett. 76, 169–174 (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)