反转列表-递归
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;
}