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 |
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?
how can i include my own .h file EX:- alex.h like #include<alex.h>, rather than #include"alex.h"
Where static variables are stored in c?
what is the use of pointers
main() { char *p1="Name"; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); }
Explain what is the benefit of using #define to declare a constant?
What is the usage of the pointer in c?
What's the best way of making my program efficient?
Does c have circular shift operators?
How many parameters should a function have?
what is difference between strcmp & palindrome?