Reverse Linked List II
Reverse a linked list from position m to n. Do it in one-pass.
(旋转link_list[m:n+1])
Note: 1 ≤ m ≤ n ≤ length of list.
Example:
1. In-place
具体实现方法如下:
1 | # Definition for singly-linked list. |
Reverse a linked list from position m to n. Do it in one-pass.
(旋转link_list[m:n+1])
Note: 1 ≤ m ≤ n ≤ length of list.
Example:
具体实现方法如下:
1 | # Definition for singly-linked list. |