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
What is c++ and its features?
What are virtual constructors/destructors?
Explain "const" reference arguments in function?
What is c++ similar to?
Does a derived class inherit or doesn't inherit?
How would you use the functions randomize() and random()?
What is the difference between a template and a macro?
Is c++ faster than c?
explain the reference variable in c++?
What is the use of typedef?
What is the v-ptr?
What is size of string in c++?
How do you print a string on the printer?
What is namespace std; and what is consists of?
When you overload member functions, in what ways must they differ?