class Solution{
public ListNode reverse(ListNode head){
if(head==null||head.next=0){return head;}
ListNode last=reverse(head.next);
head.next.next=head;
head.next=null;
return last;
}
public reverse1N(ListNode head,int n){
if(n==1)
{succeeder=head.next;
return head;}
ListNode last=reverseN(head.next,n-1);
head.next.next=head;
head.next=succeeder;
return last;
}
public reverseMN(ListNode head,int m,int n){
if(m==1)
return reversN(head,n);
head.next=reverseMN(head.next,m-1,n-1);
return head;
}
}
标签:head,单链,ListNode,last,int,next,lc92,默写,return From: https://www.cnblogs.com/somedieyoung/p/16732973.html