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
Can a Structure contain a Pointer to itself?
How do you define a class in c++?
Explain the concept of dynamic allocation of memory?
What are the main features of c++?
What are activex and ole?
Explain what are mutator methods in c++?
When do we use copy constructors?
What is setbase c++?
Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. Your program should work for squares of all side sizes between 1 and 20. --- │ │ │ │ │ │ ---
What are c++ tokens?
What causes a runtime error c++?
Is c++ the hardest language?
What is meant by a delegate?
Explain the static storage classes in c++.
What is the benefit of learning c++?