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 are arrays c++?
Explain stack unwinding.
Differentiate between the message and method in c++?
What is class in c++ with example?
find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.
How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?
Is c++ double?
What are namespaces in c++?
What are the extraction and insertion operators in c++?
Implement stack operations with pointers with appropriate exception checks.
Differentiate between structure and class in c++.
What are the steps in the development cycle?
what are the events occur in intr activated on interrupt vector table
What is rvalue?
What is std :: flush?