Given a single Linked list with lakhs of nodes and length
unknown how do you optimally delete the nth element from the
list?



Given a single Linked list with lakhs of nodes and length unknown how do you optimally delete the n..

Answer / vignesh1988i

first create the list of unknown length..... then get the position of the element to be deleted from the user.... the start travelling in the list.... if it encounters the position prescribed by the user ... get the addresses in the list and shift that to the previous node and free this node........


thank u

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Interview Questions

Do you have any idea about the use of "auto" keyword?

0 Answers  


how to print "hai" in c?

13 Answers   TCS,


Is main an identifier in c?

0 Answers  


what is ur strangth & weekness

0 Answers   Cognizant, LG Soft, NetEnrich,


what is diff between localstatic and globalstatis variable possible 2 use in another file...?

2 Answers   HCL,


write a prgram of swapping with 2 valiables

6 Answers  


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

0 Answers   IBM,


Explain about block scope in c?

0 Answers  


create a C program that displays one z,two y's,three x's until twenty six A's. plzz answer i need it tomorrow.

4 Answers  


int main(){ float f=8.0; if(f==8.0) printf("good"); else printf("bad"); } what is the answere and explain it?

3 Answers  


Define function ?Explain about arguments?

2 Answers   Geometric Software, Infosys,


what is mean by Garbage collection ? Please answer me. Advance thanks.

4 Answers   Excel,


Categories