Skip to content

Commit d4a3fd0

Browse files
author
laileon
committed
说明
1 parent b594b1a commit d4a3fd0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/com/blankj/custom/structure/ListNode.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ public ListNode(int val, ListNode next) {
1818
public ListNode reverseList(ListNode head) {
1919
ListNode curr = null;
2020
while (head != null) { //如果当前节点不为空
21-
ListNode tmp = head.next; //tmp赋值为head后面的节点
2221
curr = head; //prev后移一位
23-
head = tmp; //head后移一位
22+
head = head.next; //head后移一位
2423
head.next = curr; //head指向head后面那个
2524
}
2625
return curr;

0 commit comments

Comments
 (0)