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 / dark knight

1-TAKE TWO POINTERS
2-ITERATE 1 POINTER IN THE LIST UP TO THE 10th POSITION FROM STARTING
3-INITIALLY----2nd POINTER IS AT THE HEAD NODE .
4-NOW INCREEMENT both POINTER TO THE NEXT POTISION SUCH THAT THE
1st pointer reaches end .
5--2ND POINTER IS THE REQUIRED NODE

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c++ and its features?

576


What are virtual constructors/destructors?

578


Explain "const" reference arguments in function?

611


What is c++ similar to?

601


Does a derived class inherit or doesn't inherit?

618






How would you use the functions randomize() and random()?

627


What is the difference between a template and a macro?

584


Is c++ faster than c?

594


explain the reference variable in c++?

577


What is the use of typedef?

637


What is the v-ptr?

639


What is size of string in c++?

553


How do you print a string on the printer?

578


What is namespace std; and what is consists of?

666


When you overload member functions, in what ways must they differ?

590