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