//0033反转链表
class Solution {
public:
vector<int>buff;
void dfs(ListNode * root)
{
if (root == NULL)
return ;
else {
buff.push_back(root -> val);
dfs(root -> next);
}
}
ListNode* reverseList(ListNode* head) {
buff.clear();
ListNode *ans = head;
dfs(head);
int i = buff.size();
while(head) {
head -> val = buff[--i];
head = head-> next;
}
return ans;
}
};