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 are the 3 levels of programming languages?
What are the various arithmetic operators in c++?
What do nonglobal variables default to a) auto b) register c) static
What is the v-ptr?
Write about the various sections of the executable image?
What is ios in c++?
What are namespaces in c++?
What is the use of seekg in c++?
On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?
Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..
What are advantages of using friend classes?
Do you know what is overriding?
What is c++ good for?
What is microsoft c++ redistributable?
Does c++ cost money?