摘要
对二叉树先序遍历、中序遍历和后序遍历递归算法进行了分析,给出了三种遍历方法的通用递归算法。该算法只需对二叉树遍历一次,对每个结点的值域(Data)访问三次即可求出三种遍历序列。
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.
作者
尹帮治
YIN Bang-zhi (Heyuan Radio & TV University, Heyuan 517000, China)
出处
《电脑知识与技术》
2008年第7期132-134,共3页
Computer Knowledge and Technology
关键词
二叉树
遍历
递归
栈
结构数组
Binary Tree
Traverse
Recursive
Stack
Structure Array