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
How do you traverse a btree in backward in-order?
Should you pass exceptions by value or by reference?
What is the use of c++ programming language in real life?
What is math h in c++?
What is object in c++ example?
Is c++ a pure oop language?
What are the defining traits of an object-oriented language?
What is meant by a delegate?
What is the full form of dos?
Describe the advantages of operator overloading?
What is switch case in c++ syntax?
What are the extraction and insertion operators in c++?
Can we sort map in c++?
What is the difference between global variables and static varables?
How many types of classes are there in c++?