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
What are the advantages of early binding?
Difference between pointer to constant and constant pointer to a constant. Give example.
What are friend functions in C++?
Can a Structure contain a Pointer to itself?
What is math h in c++?
What is scope operator in c++?
Explain overriding.
What language does google use?
What parameter does the constructor to an ofstream object take?
What is a set in c++?
Show the application of a dynamic array with the help of an example.
What is a flag in c++?
Define Virtual function in C++.
Explain function overloading and operator overloading.
What is auto used for in c++?