标签:style blog http color os ar sp div on
typedef int DataType; typedef struct node{ DataType data; struct node* next; }LinkedNode,*LinkList; void ReverseList(LinkedNode* pCur,LinkList& ListHead) { if(NULL == pCur || NULL == pCur->next) { ListHead = pCur; } else { LinkedNode* pNext = pCur->next; ReverseList(pNext,ListHead); pNext->next = pCur; pCur->next = NULL; } } LinkedNode* ReverseList(LinkedNode* pCur,LinkList& ListHead) { if(NULL == pCur || NULL == pCur->next) { ListHead = pCur; return ListHead; } else { LinkedNode* pTemp = ReverseList(pCur->next,ListHead); pTemp->next = pCur; pCur->next = NULL; return pCur; } }
标签:style blog http color os ar sp div on
原文地址:http://www.cnblogs.com/kangbry/p/4041826.html