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 / mms zubeir

I got it, thank you.

but one suggestion, instead of using

printf("Tenth last element is %d",nodes[(pos-10)%10]->data);

you can simply give,
printf("Tenth last element is %d",nodes[pos%10]->data);

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the precedence when there is a global variable and a local variable in the program with the same name?

629


What is ofstream c++?

581


Why is the function main() special?

619


What is the latest c++ standard?

669


Can turbo c++ run c program?

624






What are c++ stream classes?

551


What does it mean to declare a destructor as static?

619


why and when we can declar member fuction as a private in the class?

1594


What are the types of array in c++?

614


Why c++ is faster than java?

588


Is std :: string immutable?

557


Explain about Virtual Function in C++?

601


What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.

554


Can non-public members of another instance of the class be retrieved by the method of the same class?

601


What is a c++ object?

611