typedef enum { Link,Thread } PointerTag;
∥ 枚举值Link和Thread分别为0和1
typedef struct node {
DataType data;
PointerTag ltag, rtag;
Struct node *lchild, *rchild;
}BinThrNode;
BinThrNode*f32 (BinThrNode *p)
{ ∥ 在中序线索树中找结点*p的中序前趋,设p非空
BinThrNode *q;
if(p->ltag==Thread1) (1) ;
else
{
q=p->lchild;
while(q->rtag=Link0) (2) ;
return q;
}
}