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 / dark knight

1-TAKE TWO POINTERS
2-ITERATE 1 POINTER IN THE LIST UP TO THE 10th POSITION FROM STARTING
3-INITIALLY----2nd POINTER IS AT THE HEAD NODE .
4-NOW INCREEMENT both POINTER TO THE NEXT POTISION SUCH THAT THE
1st pointer reaches end .
5--2ND POINTER IS THE REQUIRED NODE

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we read/write Structures from/to data files?

1064


Should I learn c or c++ first?

1072


What are maps in c++?

903


Is c++ used anymore?

1036


Write a program to find the Factorial of a number

1002


How do you find out if a linked-list has an end? (I.e. The list is not a cycle)

1103


Is it possible to pass an object of the same class in place of object reference to the copy constructor?

978


Is c++ the hardest language?

934


What is an incomplete type in c++?

1210


What is general form of pure virtual function? Explain?

941


give me an example for testing a program showing the test path .show how the test is important and complex.

2859


What is difference between array and vector in c++?

974


What is flush () in c++?

1034


How can we check whether the contents of two structure variables are same or not?

1019


how to access grid view row?

2167