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

What are examples of structures?

788


Why is c still so popular?

792


Why does this code crash?

835


What is chain pointer in c?

777


Why do we use namespace feature?

819


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

1631


What is time null in c?

764


c program to compute AREA under integral

2076


Explain the difference between call by value and call by reference in c language?

863


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

816


What is hashing in c language?

841


What is getch() function?

828


Explain what is a const pointer?

833


Write a program of advanced Fibonacci series.

895


How do I get a null pointer in my programs?

840