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
Tell me can a pure virtual function have an implementation?
What is object oriented programming (oop)?
What is the difference between a "copy constructor" and an "assignment operator" in C++?
What is polymorphism & list its types in c++?
What is the use of 'using' declaration in c++?
Which is most difficult programming language?
How can we check whether the contents of two structure variables are same or not?
Mention the ways in which parameterized can be invoked.
Can a constructor return a value?
What is pure virtual function?
Who was the creator of c++?
What is a literal in c++?
Can constructor be static in c++?
What is the difference between ++ count and count ++?
Where and why do I have to put the "template" and "typename" keywords?