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 |
print pattern 1 1 33 33 555 555 77777777 555 555 33 33 1 1
what is the difference between declaration and definition of a variable or function ?
what's the o/p int main(int n, char *argv[]) { char *s= *++argv; puts(s); exit(0); }
Why is c still so popular?
Why is conio.h not required when we save a file as .c and use clrscr() or getch() ?
can u write a program in C, which does not use = (eqaul)or any arithmatic assignment(like -=,+=,*= etc) operator to swap to number?
What are the benefits of organizational structure?
What is the main difference between calloc () and malloc ()?
State the difference between realloc and free.
WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AND SO ON......... AT LAST UNTIL Z COMES N TIMES...............
Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Quick Sort 2) Bubble Sort 3) Merge Sort
int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the call zap(6) gives the values of zap [a] 8 [b] 9 [c] 6 [d] 12 [e] 15