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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can I convert a string to a number?

643


How can I find out if there are characters available for reading?

637


What are the loops in c?

589


What is the difference between struct and union in C?

568


write an algorithm to display a square matrix.

2218






What is a protocol in c?

552


What will the code below print when it is executed?   int x = 3, y = 4;         if (x = 4)                 y = 5;         else                 y = 2;         printf ("x=%d, y=%d ",x,y);

1345


What are data types in c language?

578


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

1644


write a program fibonacci series and palindrome program in c

630


How do you construct an increment statement or decrement statement in C?

735


Is printf a keyword?

755


What is the meaning of 2d in c?

607


Why cant I open a file by its explicit path?

593


Why do we use static in c?

629