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

How many pointers are required to reverse a link list?

Answer Posted / vivek

using 2 pointer:
void reverse(node* head_in_out)
{
if(head_in_out)
{
node* aCurr = head_in_out;
node* aNext = NULL;
while (aCurr)
{
head_in_out = aCurr->next;
aCurr->next = aNext;
aNext = aCurr;
aCurr = head_in_out;
}
}

}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by late binding?

1054


Explain the use of virtual destructor?

1024


Can we define function inside main in c++?

952


Why is "using namespace std;" considered bad practice?

1035


How many standards of c++ are there?

1048


What are all predefined data types in c++?

1066


How to demonstrate the use of a variable?

1047


What is a syntax in c++?

1105


What is class invariant in c++?

1163


What are shallow and deep copies?

1066


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

1101


What operators can you overload in c++?

991


What is a class template in c++?

1000


What's the best free c++ profiler for windows?

1031


Which software is best for programming?

1094