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

Which of the following is evaluated first: a) && b) || c) !

2328


What is type of 'this' pointer?

1021


What is late binding c++?

940


Is string data type in c++?

995


What data encapsulation is in c++?

1080


Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.

1025


What is the size of a vector?

1092


what Is DCS ? what i will get benefit when i did?

2320


What is one dimensional array in c++?

1062


What does ctime() do?

1072


What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor

1116


write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)

2321


what is oops and list its features in c++?

1011


What are the advantages of using typedef in a program?

1116


Show the declaration for a static member variable.

969