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


Please Help Members By Posting Answers For Below Questions

What are the data types in c++?

517


What does int * mean in c++?

635


What are friend functions in C++?

624


Explain what happens when a pointer is deleted twice?

733


Why do we use the using declaration?

662






What is a friend function in c++?

581


Name four predefined macros.

593


an integer constant must have atleast one a) character b) digit c) decimal point

556


What do you mean by delegate? Can a user retain delegates?

526


Show the declaration for a pointer to function returning long and taking an integer parameter.

575


Is java as fast as c++?

601


What is a block in c++?

550


What is #include iomanip?

542


Explain the advantages of using friend classes.

581


What are signs of manipulation?

587