
void InsertThrRight ( BiThrTree s,BiThrTree p )
{/*在中序线索二叉树中插入结点p 使其成为结点s 的右孩子*/
BiThrTree w;
p->rchild=s->rchild;
p->rtag=s->rtag;
p->lchild=s;
p->ltag=1; /*将s 变为p 的中序前驱*/
s->rchild=p;
s->rtag=0; /*p 成为s 的右孩子*/
if ( p->rtag==0 ) /*当s 原来右子树不空时,找到s 的后继w,变w 为p 的后继,p 为w 的前驱*/
{
w=InPostNode ( p );
w->lchild=p;
}
}



