首页 > 其他分享 >OFF6

OFF6

时间:2022-10-01 18:57:10浏览次数:37  
标签:head ListNode cur OFF6 vector ans

 vector<int> reversePrint(ListNode* head) {
        vector<int> ans;
        if(head==NULL){
            return ans;
        }
        ListNode* cur=head;
        while(cur!=NULL){
            ans.insert(ans.begin(),cur->val);
            cur=cur->next;
        }
       return ans;

    }

标签:head,ListNode,cur,OFF6,vector,ans
From: https://www.cnblogs.com/lwx11111/p/16747587.html

相关文章