if(head==null){
return null;
}
if(n<=0){
return null;
}
int len=0;
ListNode p=head;
while(p!=null){
len++;
p=p.next;
}
ListNode q=head;
int count=0;
while(count!=len-n){
count++;
q=q.next;
}
return q;
网友评论