// 重写
class Solution
{
public:
ListNode *reverseList(ListNode *head)
{
if(head==NULL)
return NULL;
else if (head->next == NULL)
return head;
else
{
ListNode *tmp = reverseList(head->next);
head->next->next = head;
head->next = NULL;
return tmp;
}
return reverseList(head);
}
};