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

How many levels of indirection in pointers can you have in a single declaration?

0 Answers   Agilent, ZS Associates,


How to find a missed value, if you want to store 100 values in a 99 sized array?

0 Answers   Honeywell, Zomato,


how can i include my own .h file EX:- alex.h like #include<alex.h>, rather than #include"alex.h"

1 Answers  


Where static variables are stored in c?

0 Answers  


what is the use of pointers

6 Answers   Adobe, GrapeCity,


main() { char *p1="Name"; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); }

4 Answers   CitiGroup,


Explain what is the benefit of using #define to declare a constant?

0 Answers  


What is the usage of the pointer in c?

0 Answers  


What's the best way of making my program efficient?

0 Answers   Celstream,


Does c have circular shift operators?

0 Answers  


How many parameters should a function have?

0 Answers  


what is difference between strcmp & palindrome?

3 Answers  


Categories