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?



How would you sort a linked list?..

Answer / 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

More C Interview Questions

Do you know what are the properties of union in c?

0 Answers  


What is the output of below code? main() { static int a=5; printf("%3d",a--); if(a) main(); }

1 Answers  


How to develop software using "c" programming?

1 Answers   IBM, TCS,


What is memmove?

1 Answers   Oracle,


write a program that finds the factorial of a number using recursion?

13 Answers   Infosys, TATA,


Two's compliment of -5

4 Answers   Adobe,


Why structure is used in c?

0 Answers  


Is c easy to learn?

0 Answers  


what is the similarities between. system call and library function?

1 Answers   Wipro,


What Is The Difference Between Null And Void Pointer?

0 Answers   TCS,


Can you subtract pointers from each other? Why would you?

0 Answers  


Can we change the value of static variable in c?

0 Answers  


Categories