标签:
void reverse(Node*& head) { if (!head) return; Node *p1, *p2, *p3; p1 = head; p2 = p1->next; p1->next = NULL; while (p2) { p3 = p2->next; p2->next = p1; p1 = p2; p2 = p3; } head = p1; }
链表反转
原文地址:http://www.cnblogs.com/litao-tech/p/4330289.html