标签:
链表反转简单实现
Node* rever(Node* Head) { if(Head == NULL || Head->next == NULL) return Head; Node* cur, next, next_next; cur = Head; next = cur->next; while(cur->next != NULL){ next_next = next->next; next->next = cur; cur = next; next = next_next; } Head->next = NULL; return cur; }
标签:
原文地址:http://www.cnblogs.com/chengsheng/p/5887968.html