力扣刷题 8.反转链表——简单题

/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode(int x) : val(x), next(NULL) {}
 * };
 */
class Solution {
   
public:
    ListNode* reverseList(ListNode* head) {
   

        ListNode *former = NULL;
        ListNode *mid 

你可能感兴趣的:(c++,leetcode)