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 exceptions c++?

1001


What does ios :: app do in c++?

983


What is exception handling? Does c++ support exception handling?

982


What is the most common mistake on c++ and oo projects?

939


Is c++ built on c?

975


What is meant by const_cast?

1093


What is copy constructor? Can we make copy constructor private in c++?

1043


What is null c++?

1080


Define a constructor - what it is and how it might be called (2 methods)?

1083


Write is a binary search tree? Write an algo and tell complexity?

985


What is a string example?

1035


What is enum c++?

1165


Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..

3801


What is the use of "new" operator?

1092


Explain some examples of operator overloading?

1051