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
What is the precedence when there is a global variable and a local variable in the program with the same name?
What is ofstream c++?
Why is the function main() special?
What is the latest c++ standard?
Can turbo c++ run c program?
What are c++ stream classes?
What does it mean to declare a destructor as static?
why and when we can declar member fuction as a private in the class?
What are the types of array in c++?
Why c++ is faster than java?
Is std :: string immutable?
Explain about Virtual Function in C++?
What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.
Can non-public members of another instance of the class be retrieved by the method of the same class?
What is a c++ object?