题干
struct ListNode* ReverseList(struct ListNode* head ) {
if (head == NULL||head->next==NULL ) {
return head;
} else {
struct ListNode* Phead=head;
struct ListNode* temp=head->next;
Phead->next=NULL;
Phead=temp;
temp=temp->next;
while (temp) {
Phead->next=head;
head=Phead;
Phead=temp;
temp=temp->next;
}
Phead->next=head;
head=Phead;
}
return head;
}