This article discusses how to use queue to make non-recursion algorithm of binary link tree. As for a general binary tree, if we adopt sequence storage, firstly we should extend it first into a complete binary tree, secondly we store it to a temporary queue according to the sequence of up-down and left-right. On the basis of the properties of the complete binary tree and the queue, if we can confirm every element in the queue, then we can find the left and right children of the element in the queue. When we recur these steps, we can create a binary link bit tree. This algorithm enriches the method from recursion to non-recursion.
Keywords
Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
References
Changbao Shu, Zhenhai Liu, A Non-recursion Algorithm about Tower of Hanoi, Computer Development & Applications, Vol. 15, No. 11, 2002, pp. 33-34.
Chuanhong Chen, Wuying Shen, The Research and Application of Traversing Binary Tree, Journal of Xiaogan University, Vol. 25, No. 3, 2005, pp. 72-73.
Chunbao Li, Hui Zeng, Zhimin Zhang, Praxis of Program of Data Structure, The Press of Qinghua University, 2002.
Fuying Wu, Luosheng Tan, Mingwen Wang, Nonrecursive Algorithm of Inorder Traversing Sequential Storage Full Binary, Journal of Jiangxi Normal University (Natural Sciences Edition), Vol. 27, No. 4, 2003, pp. 372-375.
Naixiao Zhang, Algorithm and Data Structure, Higher Education Press, 2002.
Shuqun Gong, Yu Ren, Weiwei Chen, The Front and Rear Pointer Design of Circular Queue GONG, Modem Computer, No. 2, 2007, pp. 17-20.
Tao Zhu. Judging Fully Binary Tree on the Basis of Traversing Binary Tree [J]. Journal of Honghe University , Vol. 3, No. 6, 2005, pp. 47-48.
Wanlan Tian, The Discussion of Inorder-traversing and Postorder-traversing Binary-tree with Recursive Algorithm, Journal of Liangshan University, Vol. 5, No. 3, 2003, pp. 3-3.
Weimin Yan, Weimin Wu, Data Structure (C Language), The Press of Qinghua University, 1997.
Xiaoyun Guo, Non-recursive Simulation on Recursive Function, Journal of Xuzhou Normal University (Natural Science Edition), Vol. 22, No. 1, 2004, pp. 40-42.
Yongping Gao, Shumin Zhou, Use Stack to Make the Non-recursion Algorithm of Bit Link Tree, Computer Era, No. 11, 2005, pp. 24-25.
Yuansong Li, New Method of Traversing Binary Tree, Journal of Sichuan University of Science & Engineering (Natural Sicence Edition), Vol. 16, No. 4, 2003, pp. 45-46.
Yuli Yuan, Ling Hu, The Teaching Analysis of Inorder Traversing Binary Tree in the Data Structure, Journal of Neijiang Teachers College, Vol. 21, No. 4, 2006, pp. 109-111.
Zhenyuan Zhu, Cheng Zhu, Non-recursive Implementation of Recursive Algorithm, MiniMicro Systems, Vol. 24, No. 3, 2003, pp. 567-570.
Zhili Tang, Methods for uniquely determining a tree or a binary tree based on its traversal sequences, Mini-Micro Systems, Vol. 22, No. 8, 2001, pp. 985-988.
Zhong Li , Recursive Algorithm Transform into Non-recursive Algorithm , Computer Science, Vol. 28, No. 8, 2001, pp. 96-98.
Zhong Li, Lin Meng, Dehui Yin, A discussion of postorder-traverse binary tree with norecursive algorithm, Journal of Southwest University for Nationalities (Natrual Science Edition), Vol. 29, No. 5, 2003, pp. 537-538.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2008 IFIP International Federation for Information Processing
About this paper
Cite this paper
Gao, Y., Guan, F. (2008). Explore a New Way to Convert a Recursion Algorithm into a Non-recursion Algorithm. In: Li, D. (eds) Computer And Computing Technologies In Agriculture, Volume I. CCTA 2007. The International Federation for Information Processing, vol 258. Springer, Boston, MA. https://doi.org/10.1007/978-0-387-77251-6_21
Download citation
DOI: https://doi.org/10.1007/978-0-387-77251-6_21
Publisher Name: Springer, Boston, MA
Print ISBN: 978-0-387-77250-9
Online ISBN: 978-0-387-77251-6
eBook Packages: Computer ScienceComputer Science (R0)