Skip to content

Commit c4cfff0

Browse files
authored
Update Readme.md
1 parent 179b08a commit c4cfff0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Linked_List/061.Rotate-List/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
1. 确定链表的总长度Len,注意如果Len==0时的处理(此时可以顺便记录末尾节点end)
55
2. 确定实际需要旋转的次数 k=k%Len
6-
3. 令p从头指针前进 Len-k+1 步,就到了断开链表的位置。
6+
3. 令p从头指针前进 Len-k-1 步,就到了断开链表的位置。
77
4. 将p->next作为新的head,原本的end之后指向原本的head,再把p的next指向NULL,
88

99
[Leetcode Link](https://leetcode.com/problems/rotate-list)

0 commit comments

Comments
 (0)