int deletelist(LinkList &L){ LinkList q=L; if(!(q->next))//如果链表为空,删除空链表 { delete q; return OK; } LinkList g=q->next; while(g||q) { g=q->next; delete q; q=g->next; delete g; } return OK;}
相关分类