标签:turn pre eve 反转 next sel ext public class
class Solution {
public:
ListNode* ReverseList(ListNode* pHead) {
ListNode* prev = nullptr;
ListNode* curr = pHead;
while ( curr != nullptr ){
curr = pHead->next;
pHead->next = prev;
prev = pHead;
pHead = curr;
}
return prev;
}
};
标签:turn pre eve 反转 next sel ext public class
原文地址:https://www.cnblogs.com/theodoric008/p/9535024.html