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
Is it possible for a member function to use delete this?
What is decltype c++?
How a modifier is similar to mutator?
what is pre-processor in C++?
How much do coding jobs pay?
Explain about Garbage Collector?
What are the benefits of oop in c++?
What is a virtual destructor? Explain the use of it?
What is function overloading in C++?
If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?
Define the process of handling in case of destructor failure?
What is protected inheritance?
an operation between an integer and real always yeilds a) integer result b) real result c) float result
What can I safely assume about the initial values of variables which are not explicitly initialized?
Specify different types of decision control statements?