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 does namespace mean in c++?

1091


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1105


Should you pass exceptions by value or by reference?

1145


Is it possible to get the source code back from binary file?

1385


What is the difference between reference and pointer?

1174


I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.

2809


Explain the difference between static and dynamic binding of functions?

1085


Write is a binary search tree? Write an algo and tell complexity?

1031


What will happen if a pointer is deleted twice?

1200


What is the difference between global variables and local variable

1076


Write about the retrieval of n number of objects during the process of delete[]p?

1030


Write an algorithm that determines whether or not an almost complete binary tree is a heap.

3935


What are special characters c++?

1046


Explain the use of this pointer?

1164


Should I learn c++ c?

1067