常识:对普通树的遍历只有深度优先、宽度优先两种遍历方法,深度优先又可以分为先序和后序两种,但没有中序遍历之说,中序遍历只有二叉树才有。
一.递归算法
Traverse(Tree T)
{
if(T)
{
visit(T->data); //执行操作
}
Tree child;
for(child = T->firstchild; child != NULL; child = child->nextbrother)
&nbs
一.递归算法
Traverse(Tree T)
{
if(T)
{
visit(T->data); //执行操作
}
Tree child;
for(child = T->firstchild; child != NULL; child = child->nextbrother)
&nbs