[C] 在中序线索二叉树上寻找结点的先序的后继结点 →→→→→进入此内容的聊天室

来自 , 2019-11-14, 写在 C, 查看 136 次.
URL http://www.code666.cn/view/931af583
  1. BiThrTree IPrePostNode(BiThrTree head,BiThrTree p)
  2. {/*在中序线索二叉树上寻找结点p 的先序的后继结点,head 为线索树的头结点*/
  3.     BiThrTree post;
  4.     if ( p->ltag==0 ) post=p->lchild;
  5.     else
  6. {
  7.         post=p;
  8.         while ( post->rtag==1&&post->rchild!=head ) post=post->rchild;
  9.                 post=post->rchild;
  10.         }
  11. return ( post );
  12. }
  13.  
  14.  

回复 "在中序线索二叉树上寻找结点的先序的后继结点"

这儿你可以回复上面这条便签

captcha