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
Define macro.
What is the syntax for a for loop?
What is meant by the term name mangling in c++?
Differentiate between a constructor and a method in C++.
What is the difference between function overloading and operator overloading?
Please explain the reference variable in c++?
what is a class? Explain with an example.
What is a volatile variable in c++?
Can we change the basic meaning of an operator in c++?
What is a singleton class c++?
What is the latest c++ version?
How can a called function determine the number of arguments that have been passed to it?
How a pointer differs from a reference?
What are the storage qualifiers?
What are default parameters? How are they evaluated in c++ function?