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
How do I get good at c++ programming?
What are maps in c++?
What is the use of c++ programming language in real life?
Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
Is sorted c++?
What are separators in c++?
What is this pointer in c++?
write a function signature with various number of parameters.
What does it mean to declare a member function as static?
What is the difference between C and CPP?
write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;
What is c++ library?
What is flush () in c++?
How are Structure passing and returning implemented by the compiler?
How the delete operator differs from the delete[]operator?