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 / mayank pathak
Maintain a queue with ten elements. As u encounter a new
element in the linked list dequeue one element and enqueue
this new element. When the link list is fully scanned the
first element of the queue would be the 10th last element.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain the benefits of proper inheritance.
what is the difference between overloading & overriding? give example.
What are the two shift operators and what are their functions?
Can you please explain the difference between using macro and inline functions?
Why can templates only be implemented in the header file?
Why do we use iterators?
What is setbase c++?
Is arr and &arr are same expression for an array?
How to get the current position of the file pointer?
Why do we need runtime polymorphism in c++?
What is difference between c++ and c ++ 14?
Write a program to add three numbers in C++ utilizing classes.
Can we sort map in c++?
What are the uses of static class data?
What is the best c++ book for beginners?