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 / atul bodke
suppose list is already created having some elements
poninted by start ......
node* start;
node*p[10];
node* ptr;
int n=0;
ptr=start;
while(ptr->next==null)
{
p[(n++)%10]=ptr;
}
if(n<10) printf("there r unsufficient elements");
else { ptr=p[n%10]}
Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
Distinguish between a # include and #define.
How to allocate memory dynamically for a reference?
Which one is a preferred language C or C++? Why?
What are inline functions? What is the syntax for defining an inline function?
What is overloading unary operator?
What are the two shift operators and what are their functions?
What is the use of dot in c++?
What are advantages of c++?
Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.
Write some differences between an external iterator and an internal iterator?
What are c++ redistributables?
Why would you use pointers in c++?
Comment on assignment operator in c++.
Define vptr.
What is the purpose of extern storage specifier?