Here is my code to delete all the nodes having the value passed in the argument. typedef struct nodetype { int data; struct nodetype * next; } node; typedef node * list; void Linklist::deleteNode(list * head, int value) { list current = *head; list previous = *head; while(current != NULL) { if(current->data != value) { previous = current;
Kamis, 19 April 2012
Langganan:
Posting Komentar (Atom)
0 comments:
Posting Komentar