RT.
直接贴代码:
void convert(Link **head, Link *first, Link *second)
{
if(second->next == NULL)
{
*head = second;
second->next = first;
first->next = NULL;
return;
}
convert(head, first->next, second->next);
second->next = first;
first->next = NULL;
}
head 返回倒置后的链表头
阅读(271) | 评论(0) | 转发(0) |