10.10总结

class Solution {
public ListNode reverseList(ListNode head) {
if(headnull||head.nextnull){
return head;
}
ListNode newhead=reverseList(head.next);
head.next.next=head;
head.next=null;
return newhead;
}
}

posted @ 2025-10-14 00:02  Cx330。  阅读(1)  评论(0)    收藏  举报