标签:eve ext return tno question des off offer reverse
1 class Solution { 2 public: 3 ListNode* ReverseList(ListNode* pHead) { 4 if (pHead == nullptr || pHead->next == nullptr)return pHead; 5 ListNode *pre = nullptr, *cur = nullptr, *next = nullptr; 6 cur = pHead; 7 while (cur != nullptr) 8 { 9 next = cur->next; 10 cur->next = pre; 11 pre = cur; 12 cur = next; 13 } 14 return pre; 15 } 16 };
标签:eve ext return tno question des off offer reverse
原文地址:https://www.cnblogs.com/zzw1024/p/11669003.html