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 to do in place reversal of a linked list(singly or
doubly)?

Answer Posted / divakar & venkatesh

int reverse()
{
node *r,*s,*q;
s=NULL;
q=p;
while(q!=NULL)
{
r=q;
q=q->link;
r->link=s;
s=r;
}
p=r;
return;
}
this is reverse fun for single linked list.

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is n in c?

1057


What does the characters “r” and “w” mean when writing programs that will make use of files?

1484


Is c procedural or functional?

1037


Find MAXIMUM of three distinct integers using a single C statement

1071


In C programming, how do you insert quote characters (‘ and “) into the output screen?

1534


Explain the Difference between the New and Malloc keyword.

1141


Explain how do you print only part of a string?

1222


How can this be legal c?

1089


What are the advantages of using Unions?

1121


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

1135


Can the size of an array be declared at runtime?

1088


What does %d do?

1280


What is a constant?

1064


What is the difference between strcpy() and memcpy() function in c programming?

1090


How is pointer initialized in c?

1027