代碼如下: void Del_X_3(LinkList &L,ElemType x) { LNode *p; if(L==NULL) return ; if(L->data==x) { p=L; L=L->next; free(p ...
void deleteLinkList(LinkList *&L){ LinkList *p=L->next,*s,*q; while(p!=NULL){ q=p; while(q->next!=NULL ...
我在之前一篇博客《C語言實現單鏈表節點的刪除(不帶頭結點)》中具體實現了怎樣在一個不帶頭結點的單鏈表的刪除一個節點,在這一篇博客中我改成了帶頭結點的單鏈表。代碼演示樣例上傳至 https://github.com/chenyufeng1991 ...