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
What are the data types in c++?
What does int * mean in c++?
What are friend functions in C++?
Explain what happens when a pointer is deleted twice?
Why do we use the using declaration?
What is a friend function in c++?
Name four predefined macros.
an integer constant must have atleast one a) character b) digit c) decimal point
What do you mean by delegate? Can a user retain delegates?
Show the declaration for a pointer to function returning long and taking an integer parameter.
Is java as fast as c++?
What is a block in c++?
What is #include iomanip?
Explain the advantages of using friend classes.
What are signs of manipulation?