用C语言构造一棵线索二叉树,后序遍历线索二叉树如何遍历这是我编的,head是一个头结点;void PostOrderTraverse(BiTree head){BiTree tp;tp=head->lchild;while(tp!=head){\x05 while(tp->ltag!=1&&tp!=head) tp=tp->lchild; //这

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/12 03:27:19
用C语言构造一棵线索二叉树,后序遍历线索二叉树如何遍历这是我编的,head是一个头结点;void PostOrderTraverse(BiTree head){BiTree tp;tp=head->lchild;while(tp!=head){\x05 while(tp->ltag!=1&&tp!=head) tp=tp->lchild; //这

用C语言构造一棵线索二叉树,后序遍历线索二叉树如何遍历这是我编的,head是一个头结点;void PostOrderTraverse(BiTree head){BiTree tp;tp=head->lchild;while(tp!=head){\x05 while(tp->ltag!=1&&tp!=head) tp=tp->lchild; //这
用C语言构造一棵线索二叉树,后序遍历线索二叉树如何遍历
这是我编的,head是一个头结点;
void PostOrderTraverse(BiTree head)
{
BiTree tp;
tp=head->lchild;
while(tp!=head)
{
\x05 while(tp->ltag!=1&&tp!=head) tp=tp->lchild; //这里会出错?
\x05 while(tp->rtag!=1&&tp!=head) tp=tp->rchild;
\x05 if(tp!=NULL)
\x05 printf("%4c",tp->data);
\x05 tp=tp->rchild;
}
}
最后是无限循环输出
请问如何改?一定 要在线索二叉树上后序遍历哦

用C语言构造一棵线索二叉树,后序遍历线索二叉树如何遍历这是我编的,head是一个头结点;void PostOrderTraverse(BiTree head){BiTree tp;tp=head->lchild;while(tp!=head){\x05 while(tp->ltag!=1&&tp!=head) tp=tp->lchild; //这
把BitTree定义粘一下呗