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 are the effects after calling the delete this operator ?

1061


What is the maximum value of a unsigned char a) 255 b) 256 c) 128

1073


What is the use of typedef?

1102


What is the fastest c++ compiler?

1110


What is the main purpose of overloading operators?

1153


What are move semantics?

1168


How can I learn dev c++ programming?

1063


What is the most useful programming language?

1051


What are register variables?

1154


What are the extraction and insertion operators in c++?

1004


What are the basic data types used in c++?

1041


What is the disadvantage of using a macro?

1127


Name the implicit member functions of a class.

1085


How is modularity introduced in C++?

1214


What is the best free c++ compiler for windows?

1112