Abstract
The present algorithm can not be applied to construct a binary tree by using the traversal sequences in which there are same elements. That is to say, the previous algorithms require there are not same elements in the binary tree. This paper designs an improved recursive algorithm to solve the problem. Based on the existing recursive algorithm, this algorithm introduces flag sequences for the traversal sequences. According to the relationship among the elements in the flag sequences, it is theoretically proved that there are three recursive algorithms that can construct binary trees from the traversal sequences. Simulation results show that the algorithm designed in this paper can construct binary trees through the traversal sequences in which there are same elements.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Yan, Y.M., Wu, W.M.: Data Structure. Tsinghua University Press, Beijing (1992)
Xiang, L.M., Lawi, A., Ushijima, K.: On constructing a binary tree from its traversals. Res. Rep. Inf. Sci. Electr. Eng. Kyushu Univ. 5(1), 13–18 (2000)
Mikinen, E.: Constructing a binary tree efficiently from its traversals. Int. J. Comput. Math. 75, 143–147 (2000)
Tang, Z.L.: Algorithm of constructing tree based on ergodic sequence. J. Suzhou Univ. Nat. Sci. Ed. 27, 26–29 (2011)
Tang, Z.L.: An efficient algorithm for constructing a strict binary tree based on the preorder traversal sequence and the left child of the node. J. Nantong Univ. Nat. Sci. Ed. 3, 9–13 (2013)
Tang, Z.L.: A non recursive algorithm for constructing a strict binary tree by the parents of the nodes and the postorder traversal sequence. J. Nantong Vocat. Coll. 12, 93–98 (2014)
Lu, L.: A non recursive algorithm for constructing a binary tree by the traversal sequences. J. Hengshui Univ. 8, 37–40 (2009)
Wang, F.X., Zhou, K.: Establishment of the binary tree based on the sort binary tree. J. Wuhan Polytechnic Univ. 9, 53–57 (2013)
Li, L.S.: An algorithm using the traversal sequences to construct a binary tree. J. Radio TV Univ. 3, 53–54 (2010)
Zhao, G., Li, K.: Using the traversal sequences to determine the binary tree. J. Nanchang Univ. Aeronaut. Astronaut. 24, 55–59 (2013)
Zhu, T.: Reconstruction analysis of the binary tree based on the traversal sequences. J. Honghe Univ. 4, 27–30 (2013)
Hua, Z.Z.: A new method and proof for recovery of the binary tree based on the traversal sequences. J. Jiangxi Normal Univ. 5, 268–272 (2013)
Acknowledgments
This project was supported by National Natural Science Foundation of China (Grant No. 61179032), the Special Scientific Research Fund of Food Public Welfare Profession of China(Grant No. 201513004-3) and the Research and Practice Project of Graduate Education Teaching Reform of Wuhan Polytechnic University (YZ2015002).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Wang, F., Zhou, K., Qi, H., Song, B. (2016). An Improved Algorithm for Constructing Binary Trees Using the Traversal Sequences. In: Gong, M., Pan, L., Song, T., Zhang, G. (eds) Bio-inspired Computing – Theories and Applications. BIC-TA 2016. Communications in Computer and Information Science, vol 682. Springer, Singapore. https://doi.org/10.1007/978-981-10-3614-9_59
Download citation
DOI: https://doi.org/10.1007/978-981-10-3614-9_59
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-10-3613-2
Online ISBN: 978-981-10-3614-9
eBook Packages: Computer ScienceComputer Science (R0)