标签:版本 val == style 链表 log bsp ext list
递归版本:
class Solution { public: ListNode* deleteDuplication(ListNode* pHead) { if (pHead==NULL) return NULL; if (pHead!=NULL && pHead->next==NULL) return pHead; ListNode* current; if ( pHead->next->val==pHead->val){ current=pHead->next->next; while (current != NULL && current->val==pHead->val) current=current->next; return deleteDuplication(current); } else { current=pHead->next; pHead->next=deleteDuplication(current); return pHead; } } };
标签:版本 val == style 链表 log bsp ext list
原文地址:http://www.cnblogs.com/159269lzm/p/7260582.html