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
If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?
What is purpose of new operator?
Why do we need runtime polymorphism in c++?
What are the types of array in c++?
What do you mean by function and operator overloading in c++?
What are move semantics?
What do you understand by zombie objects in c++?
what is a class? Explain with an example.
Difference between pass by value and pass by reference?
What are the various operations performed on stack?
What is object oriented programming (oop)?
What is the difference between set and map in c++?
Is swift faster than c++?
Can I run c program in turbo c++?
How can I learn c++ easily?