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 |
Why pointers are used in c?
how to make a scientific calculater ?
Why we use break in c?
What is the scope of static variable in c?
extern static int i func() { i =10; i++; printf("%d \n",i); } main() { i =20; printf("%d \n",i); func(); printf("%d \n",i); }
What is ctrl c called?
Explain the difference between the local variable and global variable in c?
What is the difference between the local variable and global variable in c?
Why doesnt this code work?
what does exit() do?
What are two dimensional arrays alternatively called as?
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.