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
What is vector processing?
How come you find out if a linked-list is a cycle or not?
Show the application of a dynamic array with the help of an example.
Explain public, protected, private in c++?
Why is c++ is better than c?
Differentiate between late binding and early binding. What are the advantages of early binding?
What is the difference between a type-specific template friend class and a general template friend class?
Where and why do I have to put the "template" and "typename" keywords?
What are the five basic elements of a c++ program?
Write a function to find the nth item from the end of a linked list in a single pass.
What do you mean by volatile and mutable keywords used in c++?
daily Routine of father
How would you implement a substr() function that extracts a sub string from a given string?
What is the full form nasa?
What is the purpose of the "delete" operator?