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 |
Explain what is the benefit of using const for declaring constants?
Given an unsigned integer, find if the number is power of 2?
What are integer variable, floating-point variable and character variable?
How can I discover how many arguments a function was actually called with?
What does calloc stand for?
accept character from keyboard untill the user presses the enter key.If the user enters any character other than upper case(A-Z)alphabets program should stop taking any input
main() { charx; while (x=0;x<=255;x++) printf("\nAscii value %d Character %c,x,x); }
Explain how can I avoid the abort, retry, fail messages?
What are the Advantages of using macro
What is output of the following program ? main() { i = 1; printf("%d %d %d\n",i,i++,i++); }
Can we include one C program into another C program if yes how?
Explain the advantages and disadvantages of macros.