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
Is c++ the hardest programming language?
What is a list c++?
Can you please explain the difference between using macro and inline functions?
What is null pointer and void pointer and what is their use?
What causes a runtime error c++?
Can you explicitly call a destructor on a local variable?
How the virtual functions maintain the call up?
Write about the members that a derived class can add?
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
When are exception objects created?
What is a rooted hierarchy?
the first character in the variable name must be an a) special symbol b) number c) alphabet
Explain the uses of static class data?
What is the best free c++ compiler for windows?
What is a breakpoint?