用的是无头节点单链表逆置的方法 class Solution { public: vector printListFromTailToHead(ListNode* head) { //无头节点单链表逆置 vector ans; ListNode *pre,*cur,*tmp; cur=head; pre=tmp=NULL; while(cur!=NULL) { tmp=cur->next; cur->next=pre; pre=cur; cur=tmp; } while(pre!=NULL) { ans.push_back(pre->val); pre=pre->nex...