![]() |
#2
xg56992011-08-12 21:15
|
void ThrTree<T>::VisitInThrTree(ThrNode<T> *p)//在中序线索链表上进行遍历
{
if(p!=NULL)
{
while(p->ltag==Child)
p=p->lchild;//查找中序遍历中的第一个结点p并访问
cout<<p->data;
while(p->rchild!=NULL)
{
p=NextInThrTree(p);//当结点p存在后继,依次访问其后继结点
cout<<p->data;
}
cout<<p->ltag;
}
}