更新 0206.翻转链表.md 修复Java版本递归写法的问题

This commit is contained in:
Evan Yang
2021-10-03 19:07:45 +08:00
committed by GitHub
parent ca06096197
commit 8b6346c4e8

View File

@ -155,9 +155,9 @@ class Solution {
temp = cur.next;// 先保存下一个节点 temp = cur.next;// 先保存下一个节点
cur.next = prev;// 反转 cur.next = prev;// 反转
// 更新prev、cur位置 // 更新prev、cur位置
prev = cur; // prev = cur;
cur = temp; // cur = temp;
return reverse(prev, cur); return reverse(cur, temp);
} }
} }
``` ```