how to do in place reversal of a linked list(singly or
doubly)?

Answer Posted / ashish gupta

rev()
{
struct node *a1,*a2,*a3;
if(start->next==NULL) /*Only one element exists*/
return;
a1=start;
a2=a1->next;
a3=a2->next;
a1->next=NULL;
a2->next=a1;
while(a3!=NULL)
{
a1=a2;
a2=a3;
a3=a3->next;
a2->next=a1;
}
start=a2;
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above

651


Explain what are multidimensional arrays?

596


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

591


What is bubble sort technique in c?

586


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1196






any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

650


application attempts to perform an operation?

1489


the question is that what you have been doing all these periods (one year gap)

1614


What is NULL pointer?

671


Why does everyone say not to use gets?

603


Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1

3651


What is the difference between the = symbol and == symbol?

619


What is the purpose of void pointer?

590


Explain the binary height balanced tree?

718


Describe dynamic data structure in c programming language?

599