【leetcode】Reverse Linked List(easy)

Reverse a singly linked list.

思路:没啥好说的。秒...

ListNode* reverseList(ListNode* head) {
        ListNode * rList = NULL, * tmp = NULL;
        while(head != NULL)
        {
            tmp = rList;
            rList = head;
            head = head->next;
            rList->next = tmp;
        }
        return rList;
    }
原文地址:https://www.cnblogs.com/dplearning/p/4519080.html