方法一:迭代法 import java.util.*; /* * public class ListNode { * int val; * ListNode next = null; * public ListNode(int val) { * this.val = val; * } * } */ public class Solution { public ListNode ReverseList (ListNode head) { // 两个指针分别保存要反转的节点和前一个节点 ListNode prev = null, curr = head; while (curr != null) ...