剑指 24
address
struct ListNode* reverseList(struct ListNode* head){
if(head ==NULL)
return head;
struct ListNode * newhead = head, *p;
head = head->next;
newhead->next = NULL;
while(head){
p = head;
head = head->next;
p->next = newhead;
newhead = p;
}
return newhead;
}