leetcode刷題筆記--83. 刪除排序鏈表中的重複元素遇到的問題

如果出現Line 15: member access within null pointer of type 'struct ListNode'這樣的原因,是因爲系統編譯器不確定頭結點和頭結點的下一個節點是否爲NULL,所以要加一個while(p!=NULL&&p->next!=NULL)的語句判斷一下。 當【1,1,1】這樣的例子運用時 struct ListNode* deleteDuplic
相關文章
相關標籤/搜索