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 is object file? How can you access object file?

810


Explain how overloading takes place in c++?

757


What is abstraction in c++ with example?

757


What are all predefined data types in c++?

750


What are destructors?

733






What is pair in c++?

794


Explain the pure virtual functions?

826


What is DlgProc?

765


How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?

755


What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.

770


Is std :: string immutable?

750


What do nonglobal variables default to a) auto b) register c) static

862


Write bites in Turbo c++ Header ("Include") Files.

911


What's the "software peter principle”?

808


How to declare a pointer to an array of integers?

815