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 would you sort a linked list?

Answer Posted / prakashdasari

node *ptr1,*ptr2,*ptr3;
ptr1=start;
ptr2=ptr1->next;
ptr3=ptr2->next;
ptr1->next=NULL;
ptr2->next=ptr1;
while(ptr3!=NULL)
{
ptr1=ptr2;
ptr2=ptr3;
ptr3=ptr3->next;
ptr2->next=ptr1;
}
start = ptr2;

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 c token?

1012


Write a progarm to find the length of string using switch case?

2026


shorting algorithmS

2197


What are the types of c language?

976


Write a program to check whether a number is prime or not using c?

1009


What is structure data type in c?

970


Can a variable be both static and volatile in c?

974


What is 02d in c?

1028


Create a simple code fragment that will swap the values of two variables num1 and num2.

1237


Write a code on reverse string and its complexity.

981


Once I have used freopen, how can I get the original stdout (or stdin) back?

1030


What is scanf_s in c?

1067


What is the use of header?

1051


How do I use strcmp?

1024


What is the difference between fread and fwrite function?

1033