ListNode* reverseList(ListNode* head) {
       if(!head || !head->next){
           return head;
       }
       ListNode* temp=reverseList(head->next);
       head->next->next=head;
       head->next=nullptr;
       return temp;
    }

更多推荐