###### 一只不断成长的藏獒

/**
* struct ListNode {
*     int val;
*     ListNode *next;
*     ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *p;
int counter = 0;
for(; p != NULL; ) {
counter++;
p = p->next;
}

if(counter == 0) {
return NULL;
}

if(counter == 1) {
}

if(counter == 2) {
ListNode *p21, *p22;
p22 = p21->next;
p21->next = NULL;
p22->next = p21;
return p22;
}

ListNode *p1, *p2, *p3;
for(; p3 != NULL; ) {
p2->next = p1;
p1 = p2;
p2 = p3;
p3 = p3->next;
}
p2->next = p1;
return p2;

}
};

#### leetcode 206: Reverse Linked List

2015-05-14 06:47:30

2016-02-19 13:39:20

#### 【LeetCode】Reverse Linked List II 解题报告

2014-12-05 15:59:28

#### Reverse Linked List II -- LeetCode

2014-04-28 04:58:33

2014-01-28 01:06:19

#### 206. Reverse Linked List [easy] (Python)

2016-05-03 17:12:10

#### LeetCode 206. Reverse Linked List(迭代和递归两种实现)

2015-07-27 14:41:15

2015-05-05 16:15:03

#### leetcode：92. Reverse Linked List II（Java）解答

2015-12-26 16:14:34

2017-05-11 16:11:55