📅  最后修改于: 2022-03-11 14:49:02.797000             🧑  作者: Mango
public ListNode reverseList(ListNode head) {
if (head == null || head.next == null) return head;
ListNode p = reverseList(head.next);
head.next.next = head;
head.next = null;
return p;
}