- 博客(0)
- 资源 (11)
- 收藏
- 关注
中序线索化
status midindex(JD bt)
{
p=bt;pr=NULL;
if(!P) return 0;
initstack(s);
while(p||!empty(s))
{if(p)
{push(s,p);
p=p->lchild;}
if(!pr->rchild)pr->rt=1;
return 1;}
else
{
p=pop(s);
visit(p,pr);pr=p;
p=->rchild;
}
else{
p=pop(s);
if(p->lc::NULL)
{p->lt=1;p->lc=pr;}
if(pr&&pr->rc==NULL)
{pr->rt=1;pr->rc:p;}
pr=p;
p=p->rchild;}
2011-12-01
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人