-
yes i understand now............
Code:
loc=temp->next->next; /* store B somewhere */
temp->next->next=temp->next->next->next; /* A-C-NULL */
loc->next=temp->next; /*we form a spliced list (loc)B->C->NULL*/
temp->next=loc; /* here we simply just make A->next point to B which forms A->B->C->NULL */
yes?
-
U wud have nailed this ages back if u had paid attention to what is being posted here..
even now, U r almost there, BUT ,not there yet....
for one last time , read on...
Code:
loc=temp->next->next; /* store B somewhere */ [ correct]
temp->next->next=temp->next->next->next; /* A-C-NULL */ [ correct]
loc->next=temp->next; /*we form a spliced list (loc)B->C->NULL*/ [ wrong !!]
I have forgotten how many times I have written that
BOTH "B->next" and "A->next" point to C
Its not hard to imagine.. We just have two pointer pointing to one location..
AND A is still there in ur list..
go back to the prev page and look at the explanation for the same thing.
Code:
temp->next=loc; /* here we simply just make A->next point to B which forms A->B->C->NULL */ [ correct]
U have reached the end result correctly , but u must perfectly understand how..