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...

Write a program to reverse a linked list?

Answer Posted / surendra

suppose p is the head pointer.


r=NULL;
while(p)
{
q=r;
r=p;
p=p->next;
r->next=q;
}
p=r;

Is This Answer Correct ?    16 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how the virtual base class is different from the conventional base classes of the opps.

1100


Why do we need constructors in c++?

1057


How do you compile the source code with your compiler?

1001


What is a static member?

1000


What is a linked list in c++?

998


Using a smart pointer can we iterate through a container?

1021


Write about c++ storage classes?

1146


What is the use of ::(scope resolution operator)?

1017


What do you mean by delegate? Can a user retain delegates?

882


How would you implement a substr() function that extracts a sub string from a given string?

991


What is the use of this pointer in c++?

966


Difference between inline functions and macros?

973


What is the use of register keyword with the variables?

893


What is constructor c++?

1062


What is vector processing?

1112