I have a linklist A->B->C->D my head pointer is on A i want to delete node c with only one head pointer. i dont want any code just explanation.
+1
A:
Delete node C and make B->next to D.
When traversing the list you probably want to store the previous node in a variable, so when you hit C, you set the prev node's (which is B) next to D.
Tuomas Pelkonen
2010-03-10 14:24:05
how to delete c just one pointer.that is on A node
hasnain raza
2010-03-10 14:26:06
delete A->next->next;A->next->next = D;Now the list will be A->B->D
Tuomas Pelkonen
2010-03-10 14:27:30
A:
You walk the list, keep both the node you are currently looking at, and the previous one. When you find the node you want to delete, you change the link in the previous node to point to the next node.
You need to special case if you end up wanting to delete the head node as well.
Douglas Leeder
2010-03-10 14:26:15