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

Tell me can a pure virtual function have an implementation?

1100


What is object oriented programming (oop)?

1170


What is the difference between a "copy constructor" and an "assignment operator" in C++?

1115


What is polymorphism & list its types in c++?

1118


What is the use of 'using' declaration in c++?

1193


Which is most difficult programming language?

1172


How can we check whether the contents of two structure variables are same or not?

1120


Mention the ways in which parameterized can be invoked.

969


Can a constructor return a value?

1352


What is pure virtual function?

1108


Who was the creator of c++?

1106


What is a literal in c++?

1162


Can constructor be static in c++?

1167


What is the difference between ++ count and count ++?

1197


Where and why do I have to put the "template" and "typename" keywords?

1097