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

If all is successful, what should main return a) 0 b) 1 c) void

765


What is endl c++?

822


What is microsoft c++ redistributable?

766


What is iterator c++?

701


What are the advantages of c++ over c?

797






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

704


Is the declaration of a class its interface or its implementation?

923


How to tokenize a string in c++?

771


What relational operators if statements in c++?

871


What information can an exception contain?

862


What is constant in c++ with example?

839


Explain the purpose of the keyword volatile.

825


Is atoi safe?

800


How to demonstrate the use of a variable?

823


Is there structure in c++?

761