反转单向链表
SingleList* Reverse_SingleList(SingleList *head)
{
SingleList *prev = NULL;
while (head != NULL) {
SingleList *next = head->next;
head->next = prev;
prev = head;
head = next;
}
return prev;
}
{
SingleList *prev = NULL;
while (head != NULL) {
SingleList *next = head->next;
head->next = prev;
prev = head;
head = next;
}
return prev;
}
作者: flyinghearts
出处: http://www.cnblogs.com/flyinghearts/
本文采用知识共享署名-非商业性使用-相同方式共享 2.5 中国大陆许可协议进行许可,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。