OFF6
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;
}

浙公网安备 33010602011771号