1 void reverseprint(listnode *head)
2 {
3 if (head->next!=NULL)
4 {
5 reverseprint(head->next);
6 }
7 cout<<head->val<<endl;
8 }
1 void reverseprint(listnode *head)
2 {
3 if (head->next!=NULL)
4 {
5 reverseprint(head->next);
6 }
7 cout<<head->val<<endl;
8 }
本文标题:逆向输出一个链表
本文链接:https://www.haomeiwen.com/subject/geybcqtx.html
网友评论