程序员面试题精选100题<3>-数对之差的最大值倒序输出单链表--递归实现
题目: 把一个单链表倒序输出
代码:
1: struct ListNode
2: {
3: ListNode *pnext ;
4: int value ;
5: ListNode():
6: pnext(NULL),value(0){}
7: };
8: void reverseList(ListNode* pNode)
9: {
10: if (!pNode){
11: return ;
12: }
13: if(pNode){
14: reverseList(pNode->pnext) ;
15: }
16: cout<< pNode->value << "\t";
17: }