DeleteNode( Node* L, int x){ Node* p,q,r; p = q = r = L; while(p->next ! = NULL) { p = p ->next; if(p->data == x) break; r = q; q = p; } delete q; r->next = p;}