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 parameter does the constructor to an ofstream object take?
Differentiate between a constructor and a method in C++.
Can we inherit constructor in c++?
What is the best way to take screenshots of a window with c++ in windows?
What is a .lib file in c++?
Why is c++ so fast?
What is a driver program?
What is difference between n and endl in c++?
Discussion on error handling of C++ .
Are iterators pointers?
Why do we use using namespace std in c++?
How do you print a string on the printer?
What are the uses of pointers?
When does a name clash occur in c++?
What does return 0 do in c++?