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


Please Help Members By Posting Answers For Below Questions

Distinguish between a # include and #define.

653


How to allocate memory dynamically for a reference?

544


Which one is a preferred language C or C++? Why?

620


What are inline functions? What is the syntax for defining an inline function?

583


What is overloading unary operator?

604






What are the two shift operators and what are their functions?

561


What is the use of dot in c++?

625


What are advantages of c++?

564


Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.

619


Write some differences between an external iterator and an internal iterator?

589


What are c++ redistributables?

564


Why would you use pointers in c++?

628


Comment on assignment operator in c++.

713


Define vptr.

598


What is the purpose of extern storage specifier?

625