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

WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

0 Answers   Google, Infosys,


How can I call a function, given its name as a string?

4 Answers   ABC Telecom,


show how link list can be used to repersent the following polynomial i) 5x+2

0 Answers   CBSE,


How would you sort a linked list?

1 Answers  


Tell me about low level programming languages.

0 Answers   Amdocs,






What are pointers? Why are they used?

0 Answers  


Why the use of alloca() is discouraged?

2 Answers   Oracle,


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

0 Answers   HCL,


Where are local variables stored in c?

0 Answers  


Explain what is the difference between #include and #include 'file' ?

0 Answers  


How can this be legal c?

0 Answers  


question-how to run a c programme.

6 Answers  


Categories