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

WHAT IS C?

6 Answers  


What are the ways to a null pointer can use in c programming language?

0 Answers  


What's the difference between constant char *p and char * constant p?

0 Answers   Celstream,


Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Quick Sort 2) Bubble Sort 3) Merge Sort

7 Answers  


How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

2 Answers  






What are dangling pointers? How are dangling pointers different from memory leaks?

1 Answers  


a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

0 Answers   TCS,


Why is c used in embedded systems?

0 Answers  


What's a "sequence point"?

3 Answers  


what is the use of keyword volatile??

4 Answers   LG Soft,


What is the difference b/w Structure & Union?

3 Answers  


Explain what are multidimensional arrays?

0 Answers  


Categories