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 / aaptuster

Cant we simply check it using 10 dereferencing.

ptr -> ptr -> ptr -> ptr -> ->ptr and so on...

This could be generalized for n, as we could generate this
command string on the fly and execute the command ..

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are Access specifiers in C++ class? What are the types?

630


What is the full form nasa?

595


What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack

586


What programming language should I learn first?

592


Is c++ a float?

606






What is data type in c++?

559


Write a program to find the reverse Fibonacci series starting from N.

607


Distinguish between new and malloc and delete and free().

573


What is a constant reference?

622


Define Virtual function in C++.

624


Why cstdlib is used in c++?

585


What is friend class in c++ with example?

499


What is an undefined behavior and sequence points

567


Is c++ the most powerful language?

565


What is setiosflags c++?

529