Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What are the advantages of early binding?

1075


Difference between pointer to constant and constant pointer to a constant. Give example.

1128


What are friend functions in C++?

1067


Can a Structure contain a Pointer to itself?

1144


What is math h in c++?

1179


What is scope operator in c++?

1085


Explain overriding.

991


What language does google use?

1176


What parameter does the constructor to an ofstream object take?

1060


What is a set in c++?

979


Show the application of a dynamic array with the help of an example.

1142


What is a flag in c++?

1063


Define Virtual function in C++.

1102


Explain function overloading and operator overloading.

1083


What is auto used for in c++?

1053