This code deletes all nodes whose info field contains the value x.
Please modify the code to delete the only first value of x : ( maybe we need to add one line ) ( do not care about yellow .. thank you )
Extracted text: Removex() routine deletes all nodes whose info field contains the value x. void removex(NODEPTR *head , int x) { NODEPTR p , q , save; int y; q=NULL; p=*head; while (p!=NULL) if (p->info == x) {save=p; p= p->next; if (q==NULL) { freenode(*head); *head = p; else {freenode(save); q->next=p;} }else {q = p; p=p->next; } }
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here