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 返回倒置后的链表头
阅读(811) | 评论(2) | 转发(1) |