整体使用的是一种类似头插法的思路,pre为头结点,将当前cur结点不断的往前边移动。 import java.util.*; public class Solution { public ListNode reverseBetween (ListNode head, int m, int n) { ListNode res = new ListNode(-1); res.next = head; ListNode pre = res; ListNode cur = head; for (int i=0; i<m-1; i++){ pre = cur; cur = cur.next; } ...