首页 | 本学科首页   官方微博 | 高级检索  
     

二叉树遍历的通用递归算法研究与实现
引用本文:尹帮治.二叉树遍历的通用递归算法研究与实现[J].数字社区&智能家居,2008(7):132-134.
作者姓名:尹帮治
作者单位:河源市广播电视大学,广东河源517000
摘    要:对二叉树先序遍历、中序遍历和后序遍历递归算法进行了分析,给出了三种遍历方法的通用递归算法。该算法只需对二叉树遍历一次,对每个结点的值域(Data)访问三次即可求出三种遍历序列。

关 键 词:二叉树  遍历  递归    结构数组

Research and Realization of the General Recursive Algorithm of Traversing Binary Tree
YIN Bang-zhi.Research and Realization of the General Recursive Algorithm of Traversing Binary Tree[J].Digital Community & Smart Home,2008(7):132-134.
Authors:YIN Bang-zhi
Affiliation:YIN Bang-zhi (Heyuan Radio & TV University, Heyuan 517000, China)
Abstract:The paper analyses the recursion algorithm of preorder, inorder and postorder traverse of a binary tree, and defines a general recursion algorithm for the three kinds of traversing methods.this algorithm only need traverse the binary tree once, visit each node's data field three times, then three kinds of traversing sequences can be acquired.
Keywords:Binary Tree  Traverse  Recursive  Stack  Structure Array
本文献已被 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号