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 / mms zubeir

I got it, thank you.

but one suggestion, instead of using

printf("Tenth last element is %d",nodes[(pos-10)%10]->data);

you can simply give,
printf("Tenth last element is %d",nodes[pos%10]->data);

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by const correctness?

1043


How do we balance an AVL Tree in C++?

1101


Is sorted c++?

1057


Can turbo c++ run c program?

1045


What is the difference between containment and delegation?

1260


Difference between delete and free.

1031


Does std endl flush?

986


Can we delete this pointer in c++?

1166


What is an adjust field format flag?

1075


What are references in c++?

1099


Explain the volatile and mutable keywords.

1038


Why do we use using namespace std in c++?

1035


What is friend class in c++ with example?

961


Are c and c++ similar?

1002


Is c++ a low level language?

926