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 |
You have an array of n integers, randomly ordered with value 1 to n-1.The array is such that there is only one and one value occurred twice. How will you find this number?
Should I learn c before c++?
What is the difference between macros and inline functions?
a linear linked list such that the link field of its last node points to the first node instead of containing NULL a) linked list b) circular linked list c) sequential linked list d) none
Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++) main(); } Then what is the output of the program?
How would you obtain the current time and difference between two times?
What is the output of the following program main();{printf ("chennai""superkings"}; a. Chennai b. superkings c. error d. Chennai superkings
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
program to print upper & lower triangle of a matrix
Main must be written as a.the first function in the program b.Second function in the program c.Last function in the program d.any where in the program
19 Answers CTS, HCL, TCS,
What is c basic?
Write a C program to count the number of email on text