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
When one must use recursion function? Mention what happens when recursion functions are declared inline?
Are there any special rules about inlining?
Is swift faster than go?
How do pointers work?
How to give an alternate name to a namespace?
In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h
What is the latest version on c++?
Which is better c++ or java?
What are static type checking?
What is new in c++?
What does #define mean in c++?
If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?
Explain deep copy and a shallow copy?
Do the parentheses after the type name make a difference with new?
What is a forward referencing and when should it be used?