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

How do you traverse a btree in backward in-order?

614


Should you pass exceptions by value or by reference?

689


What is the use of c++ programming language in real life?

556


What is math h in c++?

602


What is object in c++ example?

615






Is c++ a pure oop language?

590


What are the defining traits of an object-oriented language?

685


What is meant by a delegate?

602


What is the full form of dos?

558


Describe the advantages of operator overloading?

569


What is switch case in c++ syntax?

616


What are the extraction and insertion operators in c++?

556


Can we sort map in c++?

587


What is the difference between global variables and static varables?

560


How many types of classes are there in c++?

588