阅读以下说明和C语言函数,将应填入(n)处的字句写在对应栏内。 [说明] 完成以下中序线索化二叉树的算法。 [函数] Typedef int datatype; Typedef struct node { Int ltag

admin2009-02-15  35

问题 阅读以下说明和C语言函数,将应填入(n)处的字句写在对应栏内。
[说明]
   完成以下中序线索化二叉树的算法。
   [函数]
   Typedef int datatype;
     Typedef struct node {
   Int ltag, rtag;
     Datatype data;
     *lchild,* rchild;
     }bithptr;
   bithptr pre;
   void inthread ( p );
    {if
   {inthread ( p->lchild );
    if ( p->lchild==unll )  (1);
    if ( P->RCHILD=NULL) p->rtag=1;
   if  (2)  
   {if  (3)  pre->rchild=p;
    if ( p->1tag==1 )(4);
    }
   INTHREAD ( P->RCHILD );
     (5);
    }
    }

选项

答案(1) P->LTAG=0 (2) (PRE) (3) (PRE->RTAG==1) (4) P->LCHILD=PRE (5) PRE=P

解析
转载请注明原文地址:https://jikaoti.com/ti/CTW7FFFM
0

相关试题推荐
最新回复(0)