2013年11月1日

单向链表的反转

摘要: #include #include #include using namespace std;class ListNode {public: ListNode *next; int data;};ListNode* reverse(ListNode * head) { ListNode *pCur, *pPrev, *pNext; pPrev = NULL; pCur = head; while (pCur != NULL) { pNext = pCur->next; pCur->next = pPrev; pPrev = pCur; pCur = pNext; } return 阅读全文

posted @ 2013-11-01 20:02 DerDeath 阅读(470) 评论(0) 推荐(0) 编辑

导航

"); }); },1000); });