题目描述206. 反转链表 - 力扣(LeetCode):
答案展示:
迭代:
递归:
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
struct ListNode* reverseList(struct ListNode* head) {
static struct ListNode*tmp1 = NULL;
if(!head)
return