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 / aaptuster

Cant we simply check it using 10 dereferencing.

ptr -> ptr -> ptr -> ptr -> ->ptr and so on...

This could be generalized for n, as we could generate this
command string on the fly and execute the command ..

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is #include iostream h in c++?

1157


List the issue that the auto_ptr object handles?

1024


Assume an array of structure is in order by studentID field of the record, where student IDs go from 101 to 500. Write the most efficient pseudocode algorithm you can to find the record with a specific studentID if every single student ID from 101 to 500 is used and the array has 400 elements. Write the most efficient pseudocode algorithm you can to find a record with a studentID near the end of the IDs, say in the range from 450 to 500, if not every single student ID in the range of 101 to 500 is used and the array size is only 300

2221


Is c++ vector dynamic?

1109


When should we use container classes instead of arrays?

1018


What does the ios::ate argument do?

1185


What is a dll entry point?

1003


How do you add an element to a set in c++?

990


an integer constant must have atleast one a) character b) digit c) decimal point

1025


How would you find out if a linked-list is a cycle or not?

1004


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

1093


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

1032


Which programming language is best?

982


What is static in c++?

1055


How a macro differs from a template?

1168