StatusPostOrderThreading(BiThrTree&T,BiThrTree&pre);//首先建立后序线索树
StatusFindNextInBiThrTree(BiThrTree&q,TElemType*p);//再进行查找
//后序线索二叉树的算法
StatusPostOrderThreading(BiThrTree&Thrt,BiThrTree&T)
{BiThrTreepre;Thrt=newBiThrNode;//为线索二叉树建立头结点if(!Thrt)exit(OVERFLOW);Thrt-
>LTag=Link;Thrt->RTag=Thread;Thrt->rchild=Thrt;//右子树回指if(!T)Thrt->lchild=Thrt;//若二叉树空,左子
树回指else{Thrt->lchild=T;pre=Thrt;
PostThreading(T,pre);//后序遍历进行后序线索化
pre->rchild=Thrt;//最后一个结点线索化
pre->RTag=Thread;Thrt->rchild=pre;}returnOK;}
StatusPostThreading(BiThrTree&T,BiThrTree&pre)
{if(T){
if(T->LTag==Link)PostThreading(T->lchild,pre);
if(T->RTag==Link)PostThreading(T->rchild,pre);
if(!T->lchild){T->LTag=Thread;___________}
if(pre&&!pre->rchild){
pre->RTag=Thread;pre->rchild=T;}pre=T;}returnOK;}
A.T->lchild=pre;
B.pre->lchild=T
C.T->rchild=pre
D.pre->rchild=T