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 / atul bodke

suppose list is already created having some elements
poninted by start ......
node* start;
node*p[10];
node* ptr;
int n=0;
ptr=start;
while(ptr->next==null)
{
p[(n++)%10]=ptr;

}
if(n<10) printf("there r unsufficient elements");
else { ptr=p[n%10]}

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible for a member function to use delete this?

556


What is decltype c++?

547


How a modifier is similar to mutator?

618


what is pre-processor in C++?

581


How much do coding jobs pay?

538






Explain about Garbage Collector?

635


What are the benefits of oop in c++?

570


What is a virtual destructor? Explain the use of it?

534


What is function overloading in C++?

711


If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?

598


Define the process of handling in case of destructor failure?

560


What is protected inheritance?

585


an operation between an integer and real always yeilds a) integer result b) real result c) float result

694


What can I safely assume about the initial values of variables which are not explicitly initialized?

606


Specify different types of decision control statements?

348