利用节点的右指针将一颗二叉树的叶子节点从左往右传承一个单链表。
void link(BTNode* p,BTNode* head,BETNode* tail)
{
if(p)
{
if(!p->left&&!p->right)
{
if(head==NULL)
{
head=p;
tail=p;
}
else
{
tail->next=p;
tail=p;
}
}
link(p->left,head,tail);
link(p->right,head,tail);
}
}