Memory is not a constraint. In a single iteration(NOTE: you
can't go back), how will you find out the 10th last
node/item in a linked list.

Answer Posted / rohith

it can be just done tis way!!
temp=first;
while(temp->link->link->link->link->link->link->link->link-
>link!=NULL)
{
temp=temp->link;
}
printf("%d",temp->data);

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is vector processing?

660


How come you find out if a linked-list is a cycle or not?

565


Show the application of a dynamic array with the help of an example.

576


Explain public, protected, private in c++?

561


Why is c++ is better than c?

512






Differentiate between late binding and early binding. What are the advantages of early binding?

570


What is the difference between a type-specific template friend class and a general template friend class?

547


Where and why do I have to put the "template" and "typename" keywords?

572


What are the five basic elements of a c++ program?

573


Write a function to find the nth item from the end of a linked list in a single pass.

561


What do you mean by volatile and mutable keywords used in c++?

570


daily Routine of father

899


How would you implement a substr() function that extracts a sub string from a given string?

557


What is the full form nasa?

593


What is the purpose of the "delete" operator?

618