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 the difference between a declaration and a definition?
Explain virtual class?
What is the difference between c++ and turbo c++?
Is c++ slower than c?
Does dev c++ support c++ 11?
What do you mean by public protected and private in c++?
Which one is a preferred language C or C++? Why?
What are the advantages of inheritance in c++?
Is c# written in c++?
Are iterators pointers?
What is the keyword auto for?
What are the 2 main types of data structures?
Can c++ be faster than c?
How can you specify a class in C++?
Explain about Garbage Collector?