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

1146


Explain stack unwinding.

1143


Differentiate between the message and method in c++?

1117


What is class in c++ with example?

1370


find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.

2606


How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?

1024


Is c++ double?

1097


What are namespaces in c++?

1139


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

1054


Implement stack operations with pointers with appropriate exception checks.

1023


Differentiate between structure and class in c++.

1139


What are the steps in the development cycle?

1160


what are the events occur in intr activated on interrupt vector table

1799


What is rvalue?

1194


What is std :: flush?

1132