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

Define macro.

1029


What is the syntax for a for loop?

1068


What is meant by the term name mangling in c++?

906


Differentiate between a constructor and a method in C++.

993


What is the difference between function overloading and operator overloading?

1033


Please explain the reference variable in c++?

1018


what is a class? Explain with an example.

1100


What is a volatile variable in c++?

1360


Can we change the basic meaning of an operator in c++?

1071


What is a singleton class c++?

966


What is the latest c++ version?

1052


How can a called function determine the number of arguments that have been passed to it?

1077


How a pointer differs from a reference?

1265


What are the storage qualifiers?

1105


What are default parameters? How are they evaluated in c++ function?

1129