class Solution {
public ListNode reverseList(ListNode head) {
if(head==null||head.next==null){
return head;
}
ListNode temp=head.next;
ListNode newHead=reverseList(head.next);
temp.next=head;
head.next=null;
return newHead;
}
}
https://www.cnblogs.com/keeya/p/9218352.html