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 / mms zubeir
I got it, thank you.
but one suggestion, instead of using
printf("Tenth last element is %d",nodes[(pos-10)%10]->data);
you can simply give,
printf("Tenth last element is %d",nodes[pos%10]->data);
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What do you mean by const correctness?
How do we balance an AVL Tree in C++?
Is sorted c++?
Can turbo c++ run c program?
What is the difference between containment and delegation?
Difference between delete and free.
Does std endl flush?
Can we delete this pointer in c++?
What is an adjust field format flag?
What are references in c++?
Explain the volatile and mutable keywords.
Why do we use using namespace std in c++?
What is friend class in c++ with example?
Are c and c++ similar?
Is c++ a low level language?