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

simple,

in case the list has say 90 elements, then for every 10
elements, he is writing to the array. though the array size
is 10, this is done by saying pos%10.
thus when the list is iterated he just substracts 10 from
the pos and then does %10 since he has to factor in, that
array starts from 0 and not from 1 :)

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a multiset c++?

1152


How would you use qsort() function to sort an array of structures?

1123


Can I learn c++ without c?

1146


Why do we use vector in c++?

1079


Why do you use the namespace feature?

1092


Who invented turbo c++?

1072


Difference between Abstraction and encapsulation in C++?

1163


What are the advantages of prototyping?

1065


Is it possible to provide special behavior for one instance of a template but not for other instances?

1134


Can recursive program be written in C++?

1232


Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement

1189


How does java differ from c and c++?

1002


What is a character in c++?

1048


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

1013


Differentiate between a constructor and a method in C++.

1059