c语言实现单链表的倒叙

bool upsidedown_list(LinkList L) {
Lnode *head, *tmp, *oldhead;
head = L;
tmp = L->next;
oldhead = L;
while (tmp) {
oldhead->next = tmp->next;
tmp->next = head;
head = tmp;
tmp = oldhead->next;
}
return true;
}

posted @ 2021-04-20 20:07  傻子爸爸  阅读(71)  评论(0编辑  收藏  举报