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 is the difference between map and hashmap in c++?

1156


Why c++ is called oop?

1171


Can c++ be faster than c?

1079


What is the use of 'this' pointer?

1296


Is map sorted c++?

1048


What is atoi?

1020


Which coding certification is best?

1074


What do you mean by public protected and private in c++?

1109


What is size_type?

1104


What is a stack c++?

1051


What is pure virtual function?

1105


What is the basic concept of c++?

1059


What are c++ stream classes?

1092


Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.

1378


Write a function to find the nth item from the end of a linked list in a single pass.

1019